Skip to content
Web Design & Development

Design Tokens in Code: The Decisions That Matter

Turning design decisions such as color and spacing into values that flow from design tools into code.

MediaScaleUp Editorial Team 2 min read 12 views
Design Tokens in Code: The Decisions That Matter

The key figures

Single source
tokens should have one authoritative definition
Transformation
tokens convert into platform-specific formats
Theming
token sets can define light, dark and brand variants
Naming
semantic names outlast literal ones

Why this is worth getting right

Tokens keep design and implementation aligned, and they make theming and rebranding far cheaper.

Do this, not that

Do

  • Keep one source of truth for tokens
  • Use semantic names rather than literal values
  • Automate transformation into code formats
  • Version tokens with the design system
  • Test theme switching

Don’t

  • Color values copied by hand into code
  • Token names describing the value rather than the use
  • Separate token sets drifting apart
  • Manual updates after design changes

When to bring in help

Our advice Bring in help when design and code drift apart.

Where this comes from

The figures and practices above come from the sources listed.

Working on something like this?

We take on Web Design & Development work for teams who want it done once, properly. Tell us what you are building and we will tell you honestly whether we are the right studio for it. Start a project.

Where to go next

Spotted something wrong? Report an error on this page. We correct on the page and say what changed.

All services

The work behind this article, and what it costs.

MediaScaleUp Editorial Team

Articles here are researched, written and checked by the MediaScaleUp studio team before they are published, and dated when they are reviewed.

Keep reading

More in Web Design & Development