How to use the design tokens generator
- Pick a starting theme: SaaS, fintech, health, developer tool, editorial, e-commerce, luxury and more.
- Set the brand colors: primary, secondary and a neutral (usually a slightly tinted grey).
- Tune the scales: base font size, type ratio, 4px or 8px spacing, radius and shadow strength.
- Add a prefix if your tokens must not clash with others (for example
ds). - Check the preview card, built entirely from your tokens.
- Export CSS variables, JSON tokens, SCSS, Tailwind v4 or JavaScript.
What’s in the set
- Color: primary, secondary and neutral scales, 50–950 (33 tokens).
- Semantic color: text, text-muted, surface, surface-muted, border, accent, accent-hover, on-accent and highlight.
- Space: 0 to 16 steps on your spacing unit, in rem.
- Text: xs to 4xl from your base size and ratio.
- Radius: sm, md, lg and full.
- Shadow: sm, md and lg, scaled by strength.
How it works
You choose three brand colors. Each one is turned into an 11-step shade scale (50–950) in OKLCH, so lightness steps look even across hues. Semantic aliases such as text, surface, border and accent then point at specific shades, which keeps contrast predictable. Spacing, type sizes, radii and shadows follow simple scales from your base values. The same token set is written out as CSS custom properties, DTCG JSON, SCSS, a Tailwind theme or a JavaScript object.
Worked examples
Example 1: a new SaaS product
Load SaaS, export CSS variables and build components with var(--color-accent), var(--space-4) and var(--radius-md). When marketing changes the brand color, update one token.
Example 2: handing tokens to designers
Export JSON and import it with a token plugin into your design tool, so design and code share the same values.
Example 3: Tailwind v4
Export Tailwind v4. The @theme block creates utilities like bg-primary-600, text-2xl and rounded-md from your tokens automatically.
Common mistakes
- Using raw scale colors in components. Prefer semantic tokens so themes are easy to swap.
- Too many tokens. Start small; add tokens when a real need appears.
- Pixel-based sizes. rem keeps the system accessible.
Naming tokens well
Good names last longer than good values. Name raw tokens by scale position (primary-600, space-4) and semantic tokens by job (color-text-muted, color-surface). Avoid names tied to appearance, such as blue or big, for semantic tokens, because the value will change with the next rebrand while the job stays the same.
Keep tokens in one source of truth and generate every format from it. If designers and developers edit separate copies, the values drift apart within weeks. The exports here are generated from the same settings, so a CSS file, a JSON file and a Tailwind theme always agree.