Skip to main content

Claude Prompt to Generate Design System Tokens

Generate design tokens from brand inputs: CSS custom properties, Tailwind config, Style Dictionary JSON and TypeScript types with a WCAG AA contrast matrix.

Fill in the placeholders

Edit the values, then copy your finished prompt.

Your Prompt
prompt.txt
Create a complete design token system for [brand_name], a developer tools SaaS.

Brand personality: modern, technical, trustworthy, innovative
Primary color: #38D39F
Target audience: software developers and engineering teams

Generate tokens for:
1. **Color Palette** — primary, secondary, neutral, semantic (success/warning/error/info), with 10 (50-950) shades each. Include dark mode variants.
2. **Typography Scale** — font families (Inter for UI, JetBrains Mono for code), sizes (xs to 4xl), weights, line heights, letter spacing
3. **Spacing Scale** — consistent spacing system (4px base)
4. **Border Radius** — from sharp to fully rounded
5. **Shadows** — elevation levels (sm, md, lg, xl) for light and dark mode
6. **Breakpoints** — responsive breakpoints with container widths
7. **Animation** — duration, easing, and common transition tokens
8. **Z-Index** — layering system

Output in 4 formats:
- CSS Custom Properties (`:root { --color-primary-500: ... }`)
- Tailwind CSS config (extend section)
- JSON (for Figma/Style Dictionary)
- TypeScript type definitions

Ensure all color combinations meet WCAG AA contrast requirements. Provide a contrast matrix for text/background pairs.

What this prompt does

This prompt scaffolds a production-ready design token system from five brand inputs: name, product type, personality, primary color, and target audience. The template generates tokens across eight categories — color palettes with a configurable shade count, typography, spacing, border radius, shadows with dark mode variants, breakpoints, animations, and a z-index layering system.

The multi-format output requirement is baked into the template itself. Depending on how you set [output_count], a single run can produce CSS custom properties, a Tailwind extend block, a Style Dictionary-compatible JSON file, and TypeScript type definitions — all from the same source of truth. That means the same token values flow into your stylesheet, your component library config, your Figma plugin, and your TypeScript codebase without manual transcription. The WCAG AA contrast matrix requirement is explicit in the template, so the model surfaces accessibility failures before they reach production rather than leaving them as a follow-up audit.

When to use it

  • Starting a new SaaS product and need a token foundation before touching any components.
  • Auditing an existing brand and rebuilding its token layer to properly support dark mode.
  • Onboarding a design-engineer pairing where Figma tokens and Tailwind config must stay synchronized.
  • Bootstrapping a white-label product shipping to multiple clients with different brand personalities.
  • Generating a baseline token set to feed into Style Dictionary for a multi-platform (web + mobile) design system.
  • Creating a contrast matrix to present to a client as part of an accessibility compliance deliverable.

Example output

For a brand named Kori (B2B SaaS, professional-calm personality, primary #38D39F, 9 shades), the Style Dictionary v3-format JSON output looks like this:

{
  "color": {
    "primary": {
      "100": { "value": "#c8f5e6" },
      "500": { "value": "#38D39F" },
      "900": { "value": "#0a4033" }
    },
    "semantic": {
      "success": { "value": "{color.primary.500}" },
      "error":   { "value": "#e53e3e" }
    }
  },
  "shadow": {
    "md": {
      "light": { "value": "0 4px 12px rgba(0,0,0,0.08)" },
      "dark":  { "value": "0 4px 12px rgba(0,0,0,0.40)" }
    }
  }
}

If you are on Style Dictionary v4, ask the model to use DTCG format instead: keys become $value and $type, and shadow composite tokens use offsetX/offsetY rather than x/y. The CSS output maps every key to a custom property under :root, with a separate block for dark mode overrides using whichever selector strategy you specify. The contrast matrix flags any pair below 4.5:1 for normal text and 3:1 for large text inline, keyed to the shade pairs it checked.

Pro tips

  • Set [shade_count] to 11 (50-950) for a Tailwind-native palette. If you're targeting an OpenProps or Material 3 scale instead, 10 shades maps cleanly. Pick one convention before generating — mixing them breaks Tokens Studio imports because each plugin expects a consistent key structure.
  • Be explicit with [font_stack]. "System UI" produces very different spacing rhythm than "Inter + DM Serif Display". If your brand uses a variable font, say so — the model will include font-variation-settings tokens rather than static weight values.
  • The WCAG matrix quality depends on shade count. With fewer than 7 shades, the model often cannot find a compliant pair for both large and small text. Request at least 9 shades whenever accessibility is a deliverable; the matrix will then call out which shade numbers to use for body copy versus UI labels.
  • Pair this with a Style Dictionary config prompt as a follow-up. The JSON output maps directly to Style Dictionary's input format. A second prompt that generates the config.json transform pipeline — specifying your platforms, transforms, and output paths — saves an hour of documentation reading and eliminates the guesswork around format registration.
  • Scope [brand_personality] tightly. "Professional and calm" generates very different animation easing curves and shadow opacity than "energetic and playful." Vague inputs like "modern" produce generic defaults. The personality string directly shapes the animation duration and easing tokens, so imprecision there propagates into every transition in your component library.

Frequently Asked Questions

Does the prompt generate dark mode tokens automatically, or do I have to request them separately?
Dark mode is built into the template — shadows, colors, and semantic tokens all include both light and dark variants in the same output. You do not need a separate prompt. For the CSS output, specify your preferred selector strategy in the prompt (for example, `.dark` for Tailwind's dark mode class, or `prefers-color-scheme: dark` for system-level detection). The template leaves this open intentionally so you can match your existing implementation rather than being locked into one approach.
Can I use the JSON output directly with Figma's Tokens Studio plugin?
Yes, but be aware of the version split. Tokens Studio v2 migrated to the W3C Design Tokens Community Group (DTCG) format. If you are importing into Tokens Studio v2 or later, ask the model to generate DTCG-format JSON — that means shadow composite tokens use `offsetX` and `offsetY` keys (not `x` and `y`), and all values use `$value` with a `$type` sibling. If the import fails on shadow tokens, this version mismatch is the most common cause. Older Tokens Studio v1 installs accept the legacy `value` key format without the dollar prefix.
What happens if my primary color cannot produce accessible text pairings across all shades?
The model will flag the failing pairs in the contrast matrix it generates rather than silently omitting them. It typically suggests fallback text colors from the neutral scale for those combinations — for instance, recommending neutral-900 on a primary-100 background rather than primary-900 on primary-100 when that pair falls below 4.5:1. If your primary color is very light or very saturated, expect the lightest two or three shades to be flagged; the recommendation is usually to reserve those shades for backgrounds and borders, not text.
Engr Mejba Ahmed

Need this built for real?

Engr Mejba Ahmed

AI Developer · Software Engineer

I'm Mejba — I design and ship production AI systems, automations, and full-stack apps. If you want this turned into a working solution for your team, let's talk.

More in Frontend Development Prompts

Engr Mejba Ahmed

Engr Mejba Ahmed

AI assistant · trained on my work

👋

Hey there!

Quick Actions

WhatsApp Direct line to me

Chat on WhatsApp

+880 1723 741224 · Replies within the hour on working days

Popular Questions

Engr Mejba Ahmed is connected
Engr Mejba Ahmed is typing...
Engr Mejba Ahmed avatar

✉ Want me to follow up? Drop your email

Engr Mejba Ahmed avatar

📞 Connect Directly

Choose how you'd like to reach me

WhatsApp

+880 1723 741224

Email

mejba.13@gmail.com

✓ Details sent! I'll get back to you shortly.

Powered by OpenAI

335+

Blog Posts

25

AI Courses

63

Projects

Services & Expertise

Pricing & Process

Learning & Resources

Connect & Support