Stockio

Design Tokens Explained: Bridging Designers and Developers

Create a practical design-token system with semantic color roles, CSS custom properties, reviewed conversions, and a safe migration process for teams.

By Jonah Weiss

Design Systems Lead ·

On this page

A shared palette does not guarantee a shared interface. One developer uses a blue value for links, another uses it for borders, and a designer changes the source swatch without knowing which screens depend on it.

Design tokens make those relationships explicit. Start with a small set of named decisions, connect them to implementation, and define how changes reach production. The goal is a reliable contract, not a large JSON file that nobody owns.

Separate values from decisions

A primitive token names a raw value, such as blue-700. A semantic token names a purpose, such as action-background. A component token narrows that purpose to a particular control when the shared role is insufficient. These layers let teams change appearance without losing intent.

Use the Color Converter (HEX, RGB, HSL, CMYK) below to compare representations while documenting your initial palette. Conversion makes values easier to share, but it does not establish whether a color is suitable for text, an error message, or a selected state.

Audit three representative screens before creating names. Record repeated values and the roles they serve. Two identical colors may require separate semantic names if they are expected to diverge later; two slightly different grays may simply be accidental duplication.

Start with the decisions that cause recurring disagreement. A useful first release might contain surface, text, border, focus, and action roles plus a small spacing scale. It does not need to describe every illustration or one-off marketing treatment.

Build a readable token hierarchy

Keep names descriptive and relationships inspectable. A developer should understand why a token exists without locating the original designer. Prefer names tied to function over names tied to a current hue, especially at the semantic layer.

:root {
--color-blue-700: #1d4ed8;
--color-blue-800: #1e40af;
--color-slate-900: #0f172a;
--color-white: #ffffff;

--color-text-primary: var(--color-slate-900);
--color-surface-default: var(--color-white);
--color-action-background: var(--color-blue-700);
--color-action-hover: var(--color-blue-800);
--color-action-text: var(--color-white);

--space-2: 0.5rem;
--space-3: 0.75rem;
--radius-control: 0.5rem;
}

.button-primary {
color: var(--color-action-text);
background: var(--color-action-background);
padding: var(--space-2) var(--space-3);
border-radius: var(--radius-control);
}

.button-primary:hover {
background: var(--color-action-hover);
}

The MDN custom properties guide explains inheritance and fallback behavior. CSS variables are one delivery format, not the definition of a token system. A product with native applications may generate several platform-specific outputs from the same source.

Avoid unnecessary component aliases at the beginning. If every button can use the shared action roles, adding another naming layer only increases maintenance. Introduce a component token when it represents a real independent decision, not because a diagram contains three boxes.

Document naming conventions with examples and counterexamples. Explain whether “default” means a theme default, an interaction state, or a baseline surface. Ambiguous vocabulary produces inconsistent usage even when the underlying values are perfectly synchronized.

Treat color conversion as a controlled operation

HEX and RGB can describe the same sRGB color, while HSL expresses that color through a different model. A conversion between these formats is not automatically a visual improvement. It is a change in representation that may make authoring or debugging more convenient.

Use the color conversion tool to inspect equivalent values and record the format expected by each consumer. Watch alpha handling and rounding. A tiny numerical change can be harmless for a decorative background yet matter near a contrast threshold.

The MDN CSS color documentation provides a reference for accepted syntax. Keep color-space assumptions visible in the token source. A wider-gamut brand color needs deliberate fallback and testing rather than an unqualified conversion to a familiar hex value.

CMYK deserves particular care. A simple numeric conversion is not a substitute for a color-managed print workflow with an agreed output profile. Do not promise exact print matching from a browser conversion. Give print partners the source specification and confirm proofs through their production process.

Store one canonical representation where possible and generate alternatives. Hand-maintained HEX, RGB, and HSL fields tend to drift because someone updates one without the others. If a consumer requires another format, make that transformation reproducible and reviewable.

Validate roles in complete themes

A semantic token must work as part of a tested pair, not in isolation. Text-primary needs a supported surface; action-text needs action-background; focus needs to remain distinguishable against the surrounding context. A list of individually attractive swatches cannot establish accessibility.

Use the UI Contrast & WCAG Accessibility Checker to verify actual foreground and background combinations. The WAI contrast guidance explains minimum text contrast and relevant exceptions. Keep large-text and normal-text assumptions explicit in documentation.

For dark mode, remap semantic roles instead of mathematically inverting primitive colors. A dark surface may need lighter borders, different elevation cues, and a less intense action background. The same numerical step in a palette does not necessarily serve the same perceptual job across themes.

Test disabled, hovered, focused, selected, and error states as combinations. Do not assume a passing default state means the whole control passes. Check transparent overlays against their real underlying surfaces, since opacity changes the effective rendered color.

Keep a small specimen page containing text, inputs, buttons, alerts, and navigation. Render every supported theme there before approving token changes. This provides a predictable review surface without pretending it replaces testing actual product screens.

Define ownership and migrate gradually

Assign decision ownership and implementation ownership. Designers may propose role changes while frontend maintainers verify generated output and regression tests. A documented review path prevents token updates from becoming silent global redesigns.

Migrate one component family at a time. Replace raw values with semantic references, compare screenshots, and remove obsolete declarations. A global search-and-replace can map a decorative blue and an interactive blue to the same role even though they need different future behavior.

Use the UI design collection as a place to connect token guidance with concrete interface patterns. In the repository, keep a changelog that explains affected roles, expected visual changes, and any required consumer updates. Classify removals and renames as breaking changes.

Deprecate old names before deleting them. An alias can provide a short migration window, but give it an owner and a removal condition. Permanent compatibility layers make the system harder to understand and encourage teams to keep using outdated vocabulary.

Measure success through fewer inconsistent implementations and faster reviews, not the total number of tokens. A smaller trusted contract is more valuable than thousands of generated names that nobody can explain or safely change.

Key takeaways

  • Separate raw values from semantic decisions and justified component overrides.
  • Keep conversion reproducible and document color-space assumptions.
  • Validate foreground and background roles together in every supported theme.
  • Give token changes clear owners, review steps, and migration notes.
  • Expand the system only when a repeated decision earns a stable name.
Featured sponsor

Reach designers & developers at work

Put your product next to the tools people use every day. One sponsor per placement, no tracking pixels.

Become a sponsor

Keep reading

Related articles

More in Design Systems
Design Systems

Dark Mode Design System: Define a Reliable Theme Contract

Define system-wide dark mode responsibilities for themes, components, assets, and persisted preferences, then test inheritance and unsupported cases before release.

Includes: Color converterJonah WeissJonah Weiss
Design Systems

Multi-Brand Design Systems: Share Components, Keep Brands

Architect a multi-brand design system with stable semantic roles, explicit brand boundaries, scoped theme application, and a test strategy for supported combinations.

Includes: Color converterJonah WeissJonah Weiss
Design Systems

Figma Variables and Modes: How to Organize Collections

Organize Figma variable collections and modes around independent decisions, with clear aliases, naming rules, code mappings, and a publishing checklist for teams.

Includes: Color converterMaya LindqvistMaya Lindqvist
Branding & Business

10 Best Brand Guidelines Examples to Learn From

Study ten public brand systems to see how organisations explain logos, colour, typography, and voice, then apply those lessons to a practical set of guidelines for your own business.

Includes: Color converterPiotr KowalskiPiotr Kowalski
Typography & Colour

15 Best Website Color Palettes and Collections

Find dependable colour collections for websites, from curated inspiration and ready-made schemes to accessible design-system palettes, plus practical advice for choosing and testing colours.

Includes: Color converterArjun RamanArjun Raman
Typography & Colour

8 Best Color Picker Apps and Browser Extensions

Compare practical colour picker apps and browser extensions for sampling screens, inspecting web pages, and saving colour values, with advice on accuracy, formats, and workflow.

Includes: Color converterNoor HaddadNoor Haddad