Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Design tokens

Linear: AUT-121

Semantic CSS variables that every component reaches for instead of the raw hex literals. Adding a new product surface means picking from this list — not introducing a new --bg-purple-deep for one component. The raw zinc palette stays in style.css :root as implementation detail; semantic aliases are the public API.

Open as live demo →

Token table

TokenRole
--surface-baseApp background — bottom of the stack
--surface-elevatedPanels + cards
--surface-popoverTray menus, dropdowns, command menus
--surface-selectedHighlighted list row inside a menu
--surface-glassTranslucent overlay over the recording
--text-primaryDefault text colour
--text-secondaryMuted labels
--text-tertiaryAxis labels, footnotes
--line-subtleDefault 1px borders
--line-strongStronger 1px borders for focus / selected
--action-recordRecord / destructive action
--action-record-hoverRecord hover state
--shadow-popoverPopover drop shadow
--shadow-elevatedCard / panel drop shadow
--radius-panelCards, popovers, tray surfaces
--radius-controlButtons, inputs
--radius-pillPill / chip badges
--focus-ringFocus outline (box-shadow)

No raw hex in component CSS

Component classes (.btn-default, .surface-popover, .badge-live, …) must reference these tokens. The only place a raw hex literal is allowed is the :root definition in style.css itself OR a token demo (the swatches above use inline style= because the tokens are the content). UI-23's grep guardrail will flag stray hex outside those locations.

Adding a new token

  1. Add the variable to :root in style.css with a comment naming the surfaces that need it.
  2. Add a row to the table above.
  3. Use it from the component CSS — never reach for a raw zinc value.
  4. If the new token can be derived from an existing one (alpha variant, hover state), prefer color-mix(...) in CSS over a new hex literal.