The dashboard’s style

How the player’s dashboard looks, moves and speaks: the tokens and parts of its style sheet, src/dashboard/style/. Use what is here before adding anything; a new part gets its line here. The components and their tests hold each screen’s details.

The dashboard is the table beside the chat where the game is played. It reads like a video game’s interface, not an office app: clear first, then good to look at, then a little delight. It never names a game’s concepts: a game system brings them as data.

1. Tokens

Every colour, corner, shadow and duration is a custom property of :root. A raw value elsewhere is a bug, except in the palettes of drawn things (maps, dice, coins, the robot). A paler or darker tone is color-mix() of a token.

Colour

Two seeds, the robot’s navy and gold. A token that changes with the theme is light-dark(), which takes colours only.

Token Use
--paper The page’s ground
--panel, --panel-2 A card; a tone above it (nested, or raised parts in the dark theme)
--float Controls standing on a card: buttons, fields, segmented controls
--cell The label’s cell in a card’s lines
--rule Borders and dividing lines
--ink, --muted Text; secondary text, inactive tabs, quiet icons
--accent What can be pressed or is chosen: links, focus ring, chosen tab, card icons. Navy on light, gold on dark
--gold, --on-gold, --gold-ink The robot’s gold in both themes: the main action, a chosen value, the player’s turn; text on it; gold as text
--action, --on-action The main action’s button; gold unless a theme sets them apart
--ally The party’s side, a success, a gain
--low, --on-low Danger: a problem, a failure, a marked foe, death
--warn A warning, as the game being away. Gold on the dark page: never beside a gold that means “chosen”
--disc The dark disc under a token
--veil, --on-veil, --on-veil-muted, --veil-low Over a picture, same in both themes; on the veil the accent is gold
--m-*, --l-*, --bio-*, --doc-* The paper and inks of maps and documents, same in both themes
--season-* The seasons, in the calendar only, always beside their word
--state-* The state layer’s strengths
  • A tinted ground is the tone at 10% over --panel, its border at 45% toward --rule; a chosen chip is the accent at 14%.
  • Colour never speaks alone: a shape, an icon or a word goes with it.
  • Text 4.5:1 and controls 3:1 against their ground, in both themes. Gold on cream is the usual failure.
  • In the dark theme the accent is the gold of “equipped” and “chosen”: a mark that is neither is --muted.

Type

  • The system sans for everything (--font, body 15px/1.4). The serif (--serif) is the story’s voice only: the campaign’s name, the master’s words and questions, the scene’s line, map names, documents.
  • Sizes: eyebrow 0.72rem uppercase 700 (.eyebrow); small 0.8rem; secondary 0.85rem; body; card title 1.125rem; title over a picture or in a dialog 1.25rem; page title 1.4rem; a number that is its box’s point 1.6rem and up, 800 for the player’s big moments.
  • Weights: 400 text, 600 a word that stands out and serif titles, 650 controls, 700 titles, names and numbers.
  • Numbers that line up are .num. List items start with a capital, in the DOM; abbreviations of fields are all capitals.

Room, corners, depth

  • Room in steps of 2 px up to 12, then 16 (--gap) and 24. Touch targets are --target (44 px).
  • Corners: --radius-xs 4 (tooltips, thin bars), --radius-s 6 (chips), --radius-m 8 (buttons, fields), --radius-l 12 (cards, notices), --radius-xl 16 (banners, dialogs). Round only tokens and dots; a pill only for a choice among peers, a switch’s track, or a small state or count label, never a button or card.
  • Depth on the light page: cards --lift, --raise; what floats --overlay; the phone’s foot bar --raise-up; a small edge --shade; light from above --glow. On the dark page depth is the surface’s tone; only what floats casts a shadow.

Motion

Token Use
--quick 100 ms State layers, tooltips, a press
--short 250 ms Most transitions
--medium 350 ms A panel or sheet coming in
--flight 450 ms Something that travels
--long 600 ms, --linger 900 ms A mark that fades after it is seen
--wait 500 ms Rest before a tooltip shows
  • --ease for most, --ease-out coming in, --ease-in leaving, --ease-bounce for one pop. Script that times motion uses the same tokens.
  • A loop only for what waits for the player: their turn, a check asked, the robot.
  • Motion never makes the player wait to act.
  • Motion goes inside @media (prefers-reduced-motion: no-preference); script checks matchMedia first. Under reduced motion only what leaves animates, at once.

2. Parts

  • Page: a PageHead (icon and title in the accent) over a .page-stack of cards, room left for the dice button. The page never changes section by itself. A long section: head, a line on what changes there do, tabs, then open cards.
  • Tabs (PageTabs): muted words, the chosen one in the accent with a bar; never wrap or widen the page, scroll sideways instead. The tab and an opened item are in the address. One Tab stop, arrows, Home, End. A .tab-mark carries a count or a lack, with tip and name.
  • Card: <details class="group"> with CardHeader (icon, title, preview while closed, chevron), keeping the player’s open state; on a phone all but the first start closed. Always open: <section class="card"> with CardHead. Never a card inside a card.
  • Buttons: .button; .gold for the one main action of a view, .quiet secondary, .danger for loss. .icon-button always with aria-label and the same words in data-tip; .tonal when it floats. What goes somewhere is a link, what does something a button.
  • Links: in the accent, thinly underlined; .md-link to a game page; OutLink out to the web, with the outward arrow after its last word, announced to a screen reader. An address to type elsewhere is text to copy, not a link.
  • Chips: a thing in a list (.chips), an effect (.effect), filters (.filter-chips, aria-pressed); a search field (.search); two to five values as .segmented. A setting that counts for nothing now is .setting.off with a line saying why, never opacity.
  • Rows: a list to open is a column of full-width buttons: name bold, meta muted, number at the end in .num. Sentences are lines, not chips.
  • Changed mark: a page the campaign changed has a small six-armed asterisk after its name (ChangedMark), muted, never inside a control.
  • List and reader: a list with a reader beside it from 900 px, in its place below; the open row is aria-current; focus goes to the reader’s title, Back returns it.
  • Widgets and package drawings: draw only with the page’s parts and the kit rpg-engine/page, in a shadow root that takes this sheet. Good marks are circles in --ally, bad ones squares in --low.
  • Notices (.notice): the page’s own messages, .problem in --low, away in --warn, info in the accent, each with its icon. The master’s words never go in a notice.
  • The master’s question: stays in sight over the page, in the serif; only a card that belongs to it uses its frame.
  • The chat: never a card; it has its own restful ground, no shadow, no card inside. The master’s words in the serif, without bubbles; the player’s at the end side. Out-of-game words differ by shape, never colour. The page draws the engine’s marks from its data. An AI app is always its name in text, never a logo.
  • Dice: an outcome against a target says Success or Failure with a tick or cross, never colour alone.
  • Dialogs and sheets: role="dialog" named by its title; focus on its first control, Esc closes and returns focus. On a phone, a sheet from the bottom (PhoneSheet). A change to the rules confirms first, Cancel focused.
  • Tooltips: one for the page (.page-tip, shell/tooltip.ts), in the top layer, reading data-tip; at a touch only for a mark that is not a control. For the eye alone: its words are also the control’s name. Every control without words has one.
  • State layer: every button, summary and a[href] lights by itself on hover, focus and press through ::after. So ::after is taken: draw other marks with ::before or an element.
  • Portraits: round, on --disc, with the pip of its side; never tinted.
  • Paper: maps and found documents are light paper with dark ink in both themes; a document’s text stays text, ornaments aria-hidden.
  • Days: rows of ten, never seven: the game has no weeks.
  • Empty and waiting: one muted sentence that says what will fill the place and who fills it; never a blank, never a spinner alone.
  • More than one player character: each is named, never “you”; with one, the page stays as it is.

3. Words

  • To the player in the second person (“your character”, “the master”). Short, plain, in the game’s words; never the machine’s (“error”, “server”, “API”). What happened, a colon, what to do.
  • Buttons and tabs in one or two words, verb first, sentence case.
  • Steps the player takes outside the page are a numbered list, framed in the accent, not a notice that goes away.
  • Every phrase through t(), in English with {placeholders}, never glued from pieces; Italian is curated in i18n/it.json. A game’s words come from its system (systemWord, labels.ts).
  • What the engine says by a code the page says in its own words (parts/refusals.ts); an app’s own words stay as they came, apart.
  • The page shows only what the character knows: an unknown page is never a link, hinted or counted.

4. Right to left, phone, keyboard, screen reader

  • Right to left: logical properties only; the page mirrors by itself. Maps and dice stay left to right. Numbers, notations and names inside sentences are isolated (isolated(), <bdi>, .num); game text has dir="auto". Arrows that point a way turn; arrow keys follow the reading (arrowStep).
  • Widths: a phone up to 600 px (one column, sections in a bottom bar); the table’s column beside the page from 900 px. Check 360 and 1280 px in both themes.
  • No widening: at 360 nothing widens the page: grids minmax(0, 1fr), long names overflow-wrap: anywhere, a row that cannot fit scrolls.
  • The phone’s screen: parts keep clear of notches with --safe-*; heights that follow the window in dvh.
  • Touch: under (pointer: coarse) controls are at least --target; a smaller-drawn control takes room around it, never overlapping another’s. Fields are 44 px and 16 px text. Hover styles inside @media (hover: hover). No tap flash, double-tap zoom, pull to reload or selection on a held control; the story’s text stays selectable.
  • Keyboard: everything is reachable; a group is one Tab stop with arrows inside; Esc closes; after a change focus goes somewhere sensible, never the body, and is never left under what stays on top. A dimmed control is aria-disabled, keeping its focus. Focus ring: the accent, 2 px, offset 2 px.
  • Screen readers: each part a landmark named by its heading; icons aria-hidden with the control named; what changes by itself in a polite role="status", said once, short.
  • Text zoomed to 200% still fits; nothing depends on hover alone.
  • Scrolling: no scrollbar is drawn anywhere. A scrolling part shows a shade of its ground where there is more (more-above, more-below, more-left, more-right, scroll-fade), never words.

5. Drawing inside the page

Rules for a package’s page code, which the page does not check:

  1. Colours, corners, durations and curves only from the tokens; no colour or font of its own.
  2. No words inside a figure, which is aria-hidden: words and numbers are the kit’s parts (Text, Value).
  3. Motion only with reduced motion off, with the tokens’ lengths; it never makes the player wait.
  4. It draws only inside its place: no document, no globals, no style="" or <style> (the security policy refuses them), pictures from its own folder.
  5. Its buttons are the kit’s, reachable by keyboard and named.
  6. Seen in both themes, right to left, with reduced motion, at 360 and 1280 px, before it ships.

6. The style sheet’s files

Plain CSS in cascade layers, no preprocessor. index.css names the layers and imports the files; the build joins them into one style.css for the page and the packages’ shadow roots (a constructed sheet takes no @import).

Layer What Where
guarantees What no sheet may remove: every outline, the tooltips, no clip or mask on a control, 16 px fields on touch; all !important guarantees.css
tokens The custom properties of :root tokens.css
theme The game system’s theme, custom properties only /api/theme
base Elements before any part base.css
parts The parts of section 2, a file each parts/
pages What belongs to one page pages/
theme-style A theme’s own style sheet, everywhere but Settings the theme’s folder
  • A later layer wins whatever the selectors; among !important rules the first layer wins, so no sheet removes the guarantees. An unlayered sheet, as a package’s, wins over all but the guarantees; a rule kept out of its file’s layer says why in a comment.
  • A new rule goes in its part’s or page’s file, inside its @layer block; motion inside the reduced-motion query, not in a layer of its own.
  • An outline or anything of a tooltip goes in guarantees.css, !important, with the --guard-* colours, never a token.
  • Look for an existing class before adding one. Selectors stay flat.

The game’s style

A game system may name a theme (game-systems.md): colours, corners, faces and the hooks below, light and dark, with variants. It changes values, never rules: each part reads a hook with today’s look as default (var(--hook, today)). Settings turns it off per system.

  • Hooks: the fonts (--font, --title-font, --serif, --number-font, --story-scale); titles (--title-*); textures (--page-texture, --bar-*, --head-picture); cards (--card-*); buttons and tabs (--button-*, --tab-*); marks (--pip-*, where bad marks stay apart by shape); shadows (--lift, --raise, --raise-up, --overlay); paper and maps (--doc-*, --map-*, --m-*, --bio-*); portraits (--portrait-*); the Theme dice (--dice-body, --dice-ink); the main action apart from the gold (--action, --on-action). The full list is in game-systems.md.
  • What stays the page’s: layout, room, sizes, motion, the state layer, focus ring and tooltips, the robot, the words, right to left and the phone.
  • A theme’s own style sheet, in theme-style, may change all of that but the focus ring and the tooltips; Settings never shows it, so the theme can always be turned off at #/settings. A system’s pageStyle is unlayered, with the same switch, at its own risk.

© 2026 Stefano Caronia · code under the MIT license