Skip to Content
gentlemans-stack
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.

tokens.json generates the web CSS, the Flutter themes and the email constants, and generate-check fails when one is stale

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

OutputConsumer
ui-libs/design-system/src/styles/tokens.cssWeb: shadcn variables for :root and .dark, @font-face (WOFF2), --radius
fonts/*.woff2Web fonts compressed from each TTF with wawoff2; --check fails if one is missing or stale
apps/*/lib/core/theme/app_tokens.g.dartEvery 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.tsEmail: emailColors (dark and light), emailFontFamily, emailRadius. Mail clients cannot read CSS variables, so the values are literal
docs/design-tokens.mdSwatch 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

On this page