What Are Design Tokens? How Token Roles Build a Color System (With a Real Example)
2026-11-08 · zhoujingkang · Founder
"Design token" has become the most-searched term in the design-engineering vocabulary — "what is design tokens" queries grew 90% this quarter, and "claude design tokens" is climbing even faster as AI agents start consuming them. Yet most explanations either talk down to designers or assume you already ship a component library. This is the plain-English version: what a token actually is, why the word "token" is doing real work in that sentence, and what separates a token file that holds up in production from a palette that falls apart by page three.
What is a design token, in one sentence?
A design token is a named, reusable decision — "our body text color is --color-on-surface" — stored as data, so that every screen, component and tool reads the same value from the same place. The Design Tokens Community Group format (the closest thing to a standard) stores tokens as JSON with a $value and a $type; CSS custom properties, Figma variables and Tailwind config entries are all common renderings of the same underlying decision.
The word "token" is borrowed from security, and the borrowing is precise: like an access token, a design token is a small, verifiable stand-in for a decision made elsewhere. The token itself is not the color — it is the promise that "on-surface always means the same color, everywhere, and here is the receipt that it was checked."
Design tokens vs CSS variables vs a color palette
A palette is a list of colors. CSS variables are a delivery mechanism. Tokens are the decision layer above both. #4F46E5 sitting in a Figma frame is a color; naming it "primary" and agreeing it means "the interactive color" makes it a token candidate; wiring it so that every button, link and focus ring reads from --color-primary is what makes it a token system.
The distinction matters most when things change. Rebranding with a palette means finding every usage by eye. Rebranding with tokens means changing one value and re-verifying a measured report — because a real token system also records what each pair was checked against, which is exactly what a palette can never carry.
Why semantic roles are the part everyone skips
Most token files stop at "primary: #4F46E5, grey-100: #F5F5F5". That is a palette with names. The layer that survives contact with real products is semantic: background, surface, text, primary, on-primary (the color that goes on top of primary), success, warning, danger and their dark-mode counterparts — each role answering "what is this for", not "what hex is this".
The gap shows up fast. One widely-shared corpus of 1,270 real DESIGN.md files contains zero files with measured contrast pairs; community posts about agent-built UIs keep finding the same failure — default themes missing success/warning roles entirely, so agents improvise with raw Tailwind classes that all break on retheme. Roles plus recorded measurements are what turn a token file into a contract an agent (or a new hire) can actually follow.
Design tokens in Figma, in code, and in AI agents
In Figma, tokens live as variables and modes ("figma design tokens" is its own search ecosystem, usually about how to export them). In code, they land as CSS custom properties, a Tailwind @theme block, or a W3C-style DTCG JSON that design and engineering both read. In AI workflows, tokens have become the contract file agents read before styling anything — DESIGN.md for Claude Code and Cursor, theme JSON for design agents.
The tooling keeps multiplying; the invariant does not. Whatever the format, a token is only doing its job if (a) it is named by role, (b) it is the single place that value lives, and (c) somebody measured the pairs it creates. Format conversations without those three are just file-format debates.
How to make your first real token system
Start from one color you already own — your brand hex. Derive the full role set from it in a tool that also measures: light and dark variants, every text/background pair, WCAG and APCA verdicts recorded. Then export into the format your stack consumes and wire the agent to read the same file. Ten minutes of generation beats a quarter of retrofitting, because every token added later inherits verified neighbors instead of guessing against unmeasured ones.
Continue with a tool
References
FAQ
What is a design token in simple terms?
A named decision about how something should look — stored as data (not hardcoded), reused everywhere, and checkable. "Text on my cards is always #1A1A1A" becomes the token text-on-surface, and every screen reads that one value.
What is the difference between design tokens and CSS variables?
CSS variables are one way to deliver tokens in a browser. Tokens are the platform-neutral decision layer: the same token can render as a CSS variable, a Figma variable, a Tailwind config entry or a JSON file. Tokens describe intent; variables are one of its shapes.
What are Figma design tokens?
Usually Figma variables and modes used to mirror a code token system, or exported token JSON (W3C/DTCG format) shared between Figma and code. The recurring pain is keeping both sides in sync — which is why teams increasingly generate both from one measured source.
Do AI coding agents need design tokens?
Yes — a token file with named roles and measured contrast pairs is the difference between an agent that invents a new grey every screen and one that reuses your system. "Claude design tokens" searches are growing fast for exactly this reason.
Try it on your own brand color
Paste one hex into the Brand Theme Engine and get a full light & dark web theme — semantic tokens, contrast-checked, export-ready.
Open the Brand Theme Engine →