Marketing pages

We’ve just launched a new feature!

Check out the new dashboard.

• 3 min read

Design tokens that scale past one product

How to name, layer and ship tokens so a second product, a rebrand or dark mode is a change of values, not a rewrite.

Nic Davidson

Co-founder & CTO

The first product is easy. Tokens are a list of colours and sizes, and everyone knows what they mean. The trouble starts with the second product, the first rebrand or the day someone asks for dark mode. This is how we structure DrumKit’s tokens so those days are a change of values, not a rewrite.


Introduction

A design token is a named decision: the colour of body text, the space between a label and its field, the radius of a card. The name goes into designs and code; the value lives in one place. Change the value and every screen follows.

That works beautifully until the names start describing values instead of decisions. A token called blue-600 can’t become green in a rebrand without lying. A token called text-link can, and nothing that uses it has to know.

A designer with short dark hair drawing on a tablet with a stylus at a wooden desk.
Megan Sims mapping a second product’s palette onto DrumKit’s semantic tokens, before a single value changed.

We learned this the slow way. DrumKit’s first tokens were a palette with sensible names, and for two years that was fine. Then we launched a second product with its own brand colour, and a search for blue-600 across our code returned four hundred results. About half meant “the brand”. The other half just meant “blue”.

Fixing it by search and replace would only have moved the problem. The real question was what each of those four hundred places meant, and only a person reading the screen could answer it. So before we renamed anything, we changed how our tokens were organised.

A token’s name is a promise about what it means. The value is only today’s answer.

Mia Ward, Head of Design

Our fix was three layers, and every token in DrumKit now sits in exactly one of them.

The first layer is primitives: the raw palette, the spacing scale, the type sizes. They are named for what they are, like gray-900 or space-4, and nothing in a product uses them directly.

The second layer is semantic tokens, named for a decision: text-primary, bg-secondary, border-error. Each points at a primitive. This is the layer designers and developers use every day, and it is the layer a theme changes. Dark mode, for example, is the same semantic names pointing at different primitives.

The third layer is component tokens, used sparingly, for the rare decision that belongs to one component, like the height of a button. They point at semantic tokens, never at primitives, so a theme still reaches them.

Software and tools

Tokens are only useful if they arrive in code unchanged. DrumKit exports them as a standard JSON file every time a library is published, and our build turns that file into CSS variables and a typed list for code completion. Nobody copies a hex value by hand.

We also lint for the two mistakes that undo the layers: a product using a primitive directly, and a semantic token pointing at another semantic token. Both fail the build with a message that names the token to use instead.

Where to begin

If you are starting out or cleaning up, this is the order we would work in, based on the migration we ran across both products last year.

  1. List every value your products use today, and group the duplicates.
  2. Name the decision behind each group, and make those names your semantic tokens.
  3. Point every semantic token at a primitive, then replace raw values in code, one screen at a time.
A tablet on a desk showing rows of colour swatches, from deep blue through violet to red.
Colour ramps on a tablet during the migration: primitives first, the semantic names that use them second.

The migration took us eleven weeks, most of it the third step. It paid for itself the first time marketing asked for a seasonal colour on the website: one value changed in one file, reviewed in the morning and live after lunch.

The bigger payoff came later. When a customer asked for a high-contrast theme, we built it in a week, because it was only a new set of answers to questions the system already asked.

What’s next?

We are bringing the same three layers to motion and elevation next, so the speed of a transition or the depth of a shadow is a named decision too. Both will ship in the token export, under the same lint rules.

Our full token set is published with the DrumKit library, with every semantic token’s reason written beside it. Borrow the structure; your values will be your own.

And if your team is halfway through a migration of its own, our customer success team will review your token structure with you, on any paid plan.

Share this post

Our blog

Latest blog posts

Tools and strategies modern teams need to help their companies grow.

No long-term contracts. No catches.

Start your 30-day free trial today.

Join 2,000+ subscribers

Stay in the loop with everything you need to know.

We care about your data in our privacy policy.