The token contract
The fixed list of CSS custom property names that a style defines, that components use and that viewers read: what is required, what is optional, how a style meets it, the check.
One list of names joins every design package. A style fills the list. Components use only the names on the list. Viewers (the style specimen, the component catalog) read the list. So a style, a component library and a viewer can each be swapped for another one built to the same contract. The list is data: contract.json, version 1.
Why these names (owner decision, 29.11.2026)
The base of the contract is the shadcn/ui theme variables, unchanged: they are the most widely used set of theme names, so
every shadcn theme and every theme generator already produces a valid style, and shadcn components take our style as it is.
The fonts and shadows are the Tailwind v4 theme namespaces. Only what these two lack is our own, under the prefix --sb-.
What a style defines
A style is a set of CSS custom properties on :root (the light scheme) and on .dark, [data-theme="dark"] (the dark scheme).
Required, the shadcn theme names. Every colour name has a value in both schemes.
| Group | Names |
|---|---|
| Surface | --background, --foreground, --card, --card-foreground, --popover, --popover-foreground |
| Action | --primary, --primary-foreground, --secondary, --secondary-foreground, --accent, --accent-foreground, --destructive |
| Quiet | --muted, --muted-foreground, --border, --input, --ring |
| Charts | --chart-1 … --chart-5 |
| Sidebar | --sidebar, --sidebar-foreground, --sidebar-primary, --sidebar-primary-foreground, --sidebar-accent, --sidebar-accent-foreground, --sidebar-border, --sidebar-ring |
| Shape | --radius (one value for both schemes) |
Optional, the Tailwind v4 namespaces (one value for both schemes): --font-sans, --font-mono, --shadow-sm,
--shadow-md, --shadow-lg. A plain shadcn theme does not set them, so they have defaults (the system fonts, the Tailwind
shadows): any shadcn theme passes the check as it is (the owner, 29.11.2026: as compatible with shadcn as possible).
Optional, our extension, with defaults. A style may leave these out; the default in contract.json applies, and it is
derived from the required names, so a plain shadcn theme still works.
| Name | What | Default |
|---|---|---|
--font-display | the display font | --font-sans |
--sb-hue-1 … --sb-hue-12 | the palette; each has -soft (a light fill), -tint (a lighter fill), -ink (text on the fill) | the five chart colours, repeated; the fills mixed with --background, the ink with --foreground |
--sb-shadow-lift | the hover shadow | --shadow-md |
--sb-shadow-sheet | the shadow of area backgrounds | --shadow-sm |
--sb-glow | the rim of the Basic card, a box-shadow | a thin ring of --primary |
--sb-edge | the card edge, a box-shadow | a thin ring of --border |
--sb-ease, --sb-dur | the motion curve and duration | cubic-bezier(0.2, 0, 0, 1), 160ms |
contract.json
{"version": 1, "required": ["--background", "…"], "colors": ["--background", "…"], "extension": {"--font-display": "var(--font-sans)", "…": "…"}}
required: every name a style must define in:root.colors: the required names that need a dark value too.extension: each optional name with its default value.
Other packages read it with readContract() from the design-tokens package (lib/contract.ts): the style packages for
their own checks, the viewers for the specimen, the libraries for the defaults.
How a style meets the contract
- Write the tokens as DTCG files:
/design/<style>/tokens.jsonand/design/<style>/tokens.dark.json. A token path maps to a name:card-foregroundis--card-foreground,sb.hue.1is--sb-hue-1. - Build them with the
buildaction of this package (the dark selector is.dark, [data-theme="dark"]) into/design/<style>/tokens.css. - Choose the style on Design:
style: <style id>. - Run
shtuk check: the checkcontract(DTK-R03) fails when a required name or a dark value is missing. It names the optional names left out, so you see which defaults apply.
For any CSS file by hand (a shadcn theme, a generator's output): shtuk run design-tokens contract --css <file>.
The same judgement as a report that never fails, in bands (full, missing, fallbacks, extra): shtuk run design-tokens health. How to make a style from a skeleton: the convention A design style.
Versions
The contract is versioned (version in contract.json). A library says which version it needs; a change that removes or
renames a required name is a new version, a new optional name is not.
/design/contract.md.Source text