ReferenceUI libs
design-tokens
Design tokens for the stack: src/tokens.json is the only definition of the stack's colors (light and dark), radii, border width, font and motion.
API
@gentlemans-stack/design-tokens/tokens.json: the token source that every generated output reads.- The generated outputs and their commands are in docs/design-tokens.md.
Fonts are part of the application: the files in fonts/ are bundled, never loaded from a CDN. Add a typeface by putting its licensed files in fonts/, listing it under font in tokens.json and regenerating.
Outputs
| Output | Consumer |
|---|---|
ui-libs/design-system/src/styles/tokens.css | Web: shadcn variables for :root and .dark, @font-face (WOFF2), --radius |
fonts/*.woff2 | Web fonts compressed from each TTF with wawoff2; --check fails if one is missing or stale |
apps/*/lib/core/theme/app_tokens.g.dart | Every Flutter app (found by apps/*/pubspec.yaml). Palettes, plus flat lightAccent / darkAccent-style const Colors |
apps/*/assets/fonts/ | TTFs copied from fonts/, because Flutter can only bundle assets inside its own package |
apps/email-templates/src/email-tokens.g.ts | Email: emailColors (dark and light), emailFontFamily, emailRadius. Mail clients cannot read CSS variables, so the values are literal |
docs/design-tokens.md | Swatch table |
Never hand-edit those outputs. Live views: /design in apps/todo-ui and the Design tokens screen in each mobile app.
Web and email share the same tokens.json values; the web reads them as CSS variables and the email templates as TypeScript constants.
Commands
pnpm nx run design-tokens:generate # write everything in the Outputs table
pnpm nx run design-tokens:generate-check # fail if any generated file is stale