Skip to content

Docs: the design system, and the rules for changing it - #2164

Merged
guidovizoso merged 1 commit into
mainfrom
guido/design-system-guide
Nov 25, 2026
Merged

guidovizoso merged 1 commit into
mainfrom
guido/design-system-guide

Conversation

@guidovizoso

Copy link
Copy Markdown
Collaborator

What this changes

A new page, docs/design-system.md, for people and coding agents to read before they change a token or a primitive, add a font, an icon set or a picture, or build a screen from a design made outside the code.

The app guidelines and "The look" say what the design system looks like today. Nothing said what must stay true when it changes, and a redesign can keep every existing rule about screens and still replace the system under them. This page is that missing part.

What the system is built on

  • It stays compatible with shadcn, checked two ways: a stock shadcn component fits in with no edit beyond its corner and shadow steps, and a stock shadcn theme restyles the whole app.
  • Surfaces come in levels: frame, panel, card, what opens beside, what sits over the app. In the page the level is the color; above it, the level is the shadow.
  • Light and dark, always both. A design with no dark version is not ready to build.

The rules that follow

  • Tokens. The set is shadcn's plus success and warning. No token for a component or a state, wherever it is declared. The shared scales keep their meaning, and names are never removed.
  • Primitives. Use one, then add shadcn's, then build. A variant or a size keeps its meaning. One system, no second kit beside the first.
  • Pictures and animation. Draw and animate in code with the tokens, so it follows dark mode, a skin and a customer's theme. No video or exported animation.
  • Building from a design. Map it to the primitives and tokens, list what doesn't map, and raise that list before building.
  • Changing the system. Agreed first, in a pull request of its own, shown in light and dark. Fix the change, never the test.

It ends with the tests that hold each rule and a checklist to run before asking for a review.

AGENTS.md now tells agents to read it before touching tokens/, app/src/components/ui or theme.css, and docs/app-guidelines.md links to it.

Not in this PR

  • A wider token test. app/tests/design-tokens.test.ts reads only :root and .dark, so a token declared in @theme passes unseen. The page says the rule is wider than the test. Closing that is a follow-up, and that sentence goes with it.
  • A skill for coding agents. The link in AGENTS.md is what points agents here for now.

How it was checked

Docs only, no code. Every link and anchor in the page resolves, and every test it names exists on main. The surface table was read against the primitives (dialog, sheet, popover, toast, tooltip).

A page for people and coding agents to read before they change a token or a primitive, add a
font, an icon set or a picture, or build a screen from a design made outside the code.

It says what the system is built on: it stays compatible with shadcn, surfaces come in levels,
and light and dark are always both drawn. Then the rules that follow from those for tokens,
primitives, pictures and animation, building from a Figma design, and how a change to the system
lands. AGENTS.md and the app guidelines link to it.
@guidovizoso
guidovizoso merged commit 37b3b97 into main Nov 25, 2026
18 checks passed
@guidovizoso
guidovizoso deleted the guido/design-system-guide branch November 25, 2026 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant