Design tokens are the interface AI needs

11/08/2026 — admin@byqreal.test
Design tokens are the interface AI needs

Tokens named for their role rather than their value give a model a vocabulary of decisions instead of a palette of colours. Semantic naming, a small closed set of values and a machine-readable source of truth are what turn generated interfaces from plausible into correct.

Tokens are usually introduced as a maintenance device: name the values so you can change them in one place. True, and a fraction of the point once a model is generating against them.

A name is a decision

Asked for "a card on a dark background", a model given raw hex codes picks a plausible dark. Given --surface-raised and --surface-sunken, it picks between two roles you defined.

The second is not merely more consistent. It is a different kind of question — a choice among decisions already made rather than a value invented on the spot.

This is why semantic naming pays off twice

The maintenance argument was always that --text-muted survives a rebrand while --grey-500 does not. The generation argument is stronger: a model reading role names produces code that stays correct when the values change, because it never encoded the value at all.

Closed sets get followed

Given six spacing values, output uses six spacing values. Given "use appropriate spacing", output uses whatever seemed appropriate in that moment, which differs from what seemed appropriate in the last one.

The discipline is to make the set genuinely closed and genuinely small. A scale with twenty steps is not a constraint; it is a suggestion with extra syntax.

Publish where code can read it

Tokens that live only inside a design tool are invisible to everything downstream. Exporting them — JSON, CSS custom properties, a typed constants file — is what makes them available to a build step, a linter and a model.

One generated source, consumed everywhere, also removes the failure where the documentation and the stylesheet disagree and nobody notices for a quarter.

Then enforce it

A token system with a hex code sitting in a component file is a system with an exception, and exceptions spread. A lint rule that rejects raw values in component code is a small piece of tooling that keeps the vocabulary real.

Tokens are only a contract if something checks the contract.

Frequently asked questions

Is not "--blue-600" clearer than "--surface-raised"?

Clearer about the value, less clear about the decision. When the brand shifts, every literal name is either wrong or has to be renamed everywhere. Semantic names keep meaning through a value change, which matters for humans and matters more for generated code that nobody reviewed line by line.

How small should the scale be?

Small enough to hold in your head. Six to eight spacing steps, a handful of surface and text roles. Every extra option is another chance for two screens to differ for no reason.

Sign in to react.
Share this post.

Comments

Sign in to join the conversation.

No comments yet. Be the first.

Don't miss this

You might also like

Structured output beats parsing prose
Structured output beats parsing prose
27/08/2026 — admin@byqreal.test

If your code needs a value from a model, ask for JSON and validate it. Regexing an answer out of a paragraph is a bug wa...

An agent is a loop, not a personality
An agent is a loop, not a personality
23/08/2026 — admin@byqreal.test

Strip away the branding and an agent is a small loop: call the model, run the tool it asked for, feed the result back, r...

Tool calling is an API contract the model can read
Tool calling is an API contract the model can read
21/08/2026 — admin@byqreal.test

A tool definition is documentation with a schema attached. Write it for a capable colleague who has never seen your syst...