DnD Story logo

Theme System Guide

This page is the live source of truth for consistent styling across components and site-wide design decisions. Match new UI work to the patterns below.

Core Tokens

Theme tokens are defined in app/globals.css and applied through DaisyUI utility classes.

TokenCurrent ValuePrimary Usage
--app-shell-bg#1e40afPrimary app shell background behind non-home pages.
--app-surface-1#f3e8ffRoot parent surface for `bg-base-100` wrappers (no border, no shadow).
--app-surface-2#dbeafeSecondary surface for nested content (`bg-base-50`).
--app-surface-3#dcfce7Tertiary surface for utility sections (`bg-base-200`).
--app-surface-4#fef9c3Quaternary surface for highlight blocks (`bg-base-300` + `border-base-300`).
--app-surface-5#ffedd5Accent surface for warm UI highlights (`bg-base-400` + `border-base-300`).
--app-surface-6#fee2e2Alert-leaning surface for stronger emphasis (`bg-base-500` + `border-base-300`).
--app-border#000000Default border color for UI chrome on themed pages.
--app-radius0.5remShared corner rounding via DaisyUI `rounded-box`.

Typography

Heading One Example

Heading Two Example

Heading Three Example

Base body text should be clear and direct for gameplay instructions and UI labels.

Use this for normal descriptive copy and section context.

Use muted text for hints, metadata, and less-critical details.

Label Style

Labels and helper text should use restrained contrast and consistent sizing.

Recommended class recipes

  • Section intro: mt-3 text-base-content/80
  • Helper copy: text-sm text-base-content/70
  • Labels: text-xs uppercase tracking-wide text-base-content/65

Color + Surfaces

Surface 1 (Root)

bg-base-100

Surface 2 (Child)

bg-base-50 border-base-300

Surface 3 (Child)

bg-base-200 border-base-300

Surface 4 (Child)

bg-base-300 border-base-300

Surface 5 (Child)

bg-base-400 border-base-300

Surface 6 (Child)

bg-base-500 border-base-300

Surfaces are intended to be layered parent-to-child. Keep Surface 1 borderless and nest deeper surfaces inside it.

Buttons

Use btn-primary for green primary actions, btn-secondary for orange support actions, btn-ghost for light white actions, btn-info for AI/info actions in purple, and btn-error for destructive actions. Outlined buttons should include a second inner line and darken slightly on hover.

Form Controls

Regular Size

Use for main create and edit forms where the page is the primary task.

Small Size

Use on busier pages where controls need to stay compact.

Validation Messaging

Use semantic text classes for state messages.

Saved successfully.

Please fill out required fields before continuing.

Form Action Rule

Treat the bottom action row as the commit point for the form. On edit pages, support the two different exit destinations directly in the footer and guard both when the form has unsaved changes.

  • Place Back to Items on the left side of the footer, and keep Submit then Cancel grouped on the right.
  • Use a compact dock wrapper with p-1.
  • Use Submit for the primary save/create action, regardless of create or edit mode.
  • Use Cancel to leave the form and return to the current record's detail page.
  • Use Back to Items to leave the form and return to the full items library.
  • If the form is dirty, both exit actions should prompt: Save and leave, Leave without saving, or Stay.
  • Breadcrumbs and other navigation links should use the same unsaved-changes guard before leaving the page.

AI Helper Demo

Use simple kid-friendly wording for robot helpers: My idea, Give me one, Start over, Make changes, and Undo.

Demo AI Helper

This demo uses the approved wording and fake lorem ipsum output.

Dungeon Summary

Do you already have an idea?

or

Image Creation Pattern

Proposed shared shell for image creation sections. Keep the overall flow predictable even when the prompt content changes by resource type.

or

Shared Section Shell

Top action row opens one of two sibling modals. The page section underneath stays compact and predictable.

Current Coverage

  • CharacterCreator image step with character tags
  • MonsterCreator monster image panel
  • ItemCreator item image panel
  • MapCreationPanel map image creator
  • MapEditor map image + inpaint flow
  • CampaignMapAttachDropdown compact create-map flow
  • DungeonStoryBuilder cover image and event scene image flows

Shared Rules

  • Top action row should always start with Use Existing Image and the AI create path.
  • Prompt area stays in the same place across modes.
  • Tags stay visible when tags are part of that mode.
  • Generated image preview and retry/edit actions stay in one predictable bottom area.
  • Mode-specific extras like scene prompt suggestion or map inpaint come after the shared core.

Recommendation: standardize the shell first, then allow mode-specific differences only in prompt wording, available tags, image size defaults, and post-generation extras like inpaint.

Cards

Use one consistent library card pattern across characters, monsters, items, images, and maps. The image and title are the entry points into the detail page, and the card should show a clear sitewide hover/focus state.

Card Rules

  • Use the same card shell across `/characters`, `/monsters`, `/items`, `/images`, and `/maps`.
  • Make the image and title clickable links to the item's `/[id]` page.
  • Do not place view, edit, or delete buttons on the card body.
  • Allow only bulk-operation controls such as a checkbox or print button when needed.
  • Use a shared hover and focus indicator on the clickable image: slate border plus a stronger slate shadow.

Recommended Hover / Focus

Image hover border: border-slate-500

Image hover shadow: shadow-[0_8px_18px_rgba(71,85,105,0.5)]

Focus ring: focus-visible:ring-2 focus-visible:ring-slate-500/40

Danger Section

Detail pages should keep editing simple at the top with one edit action, and reserve deletion for a single bottom-of-page Danger Zone. Remove other delete buttons from the rest of the UI.

Detail Page Footer Pattern

Danger Zone

Delete This Character

Permanently remove this entry and all attached data. This action cannot be undone.

Danger Zone Rules

  • Every `/[id]` page should expose one edit action near the top of the page.
  • Deletion should live only in a bottom-of-page Danger Zone section.
  • Use one descriptive warning sentence plus a single destructive button.
  • Remove delete actions from cards, list rows, and other inline surfaces.
  • Apply this same pattern to characters, monsters, items, maps, and images.

Cards, Panels, and Tables

Character Summary Card

Reusable card shell for list views and quick actions.

Nested Panel

Keep nested blocks inside base-200 for separation.

StatusExample
NormalStandard data row styling for mechanics and library tables.
AlternateZebra rows improve readability for dense game data.

Loading

Loading records...

Empty

No items found for this filter.

Error

Could not load data.

Print Theme Notes

Print layouts intentionally use a high-contrast document style. Keep print cards and sheets explicit with `print-page`, `bg-white`, `text-black`, and `border-black`.

When to use print styles

  • Dedicated print routes and printable card components.
  • Any layout expected to be exported or physically printed.
  • Grayscale helper copy with `text-gray-*` in print-specific markup.

Print Sample

Use explicit black borders and white background for reliable printer output.

Example shell: rounded-none border border-black bg-white p-4 text-black