Suzanne Sallaj

Design systems · Stage 2 of 6 · Preparing the tokens

Preparing the tokens

By Suzanne Sallaj

· 18 min read · design system series, part 2 of 2

Four lessons on what to decide before a single token is written: where the colors are kept, what your screens need to tell users, how many color families that takes, and which color stands for each.

Three words you will see a lot. A color family is one color together with all of its lighter and darker versions. A ramp is a family laid out in steps from lightest to darkest. An anchor is the one color in a family that you pick by eye. Every other step on its ramp is worked out from it.

You are here

In this article, we will cover the following:

  1. Decide where the colors are kept
  2. List the purposes
  3. Ask the three questions and count
  4. Choose one color for each family

These are lessons 2 to 5 of the thirteen it takes to build a design system. Lesson 1 was the first article in this series, Introduction to design tokens. Lessons 6 to 13 come in later articles. The full list is below, each with an example.

Part one · Make the systemSteps 1 to 5 shown
2
Decide where the colors are keptdeciding

One place where people edit the colors, one file that is the true copy, and copies made from it for every place that needs them.

ExampleA team keeps one file of colors. The design tool and the website each get a copy made from that file.
Lesson 2
3
List the purposeslisting

Write down what your screens need to tell users. Each line is one purpose.

ExampleShopify's list: what is background, what to press, action response, something to know, and two other considerations.
Lesson 3
4
Ask the three questions and countcounting

For each purpose: how many versions, is it shown with color, does it have a set of equals. Add up the color families.

ExampleShopify's count comes to seven color families.
Lesson 4
5
Choose one color for each familychoosing by eye

Pick the one color that stands for each family. This is the only step you do by eye.

ExampleOne green for success. One orange for warning. One red for critical.
Lesson 5
Lessons 6 to 13Coming in later articlesMake the shades · Name each color by its purpose · Name where each color is used · Let a tool write the files · Write the rules down · Build a checker · Change the existing screens over · Look at every screen
6
Make the shadesmath

Each chosen color gets a row of shades from light to dark, in even steps. A tool can do this.

ExampleShopify's green is not one green. Its palette has 16 shades of each color.
Lesson 6
7
Name each color by its purposenaming

Give the color a name that says what it is for, so nobody has to remember which green.

ExampleShopify's dark green, shade 12, gets the name "success".
Lesson 7
8
Name where each color is usednaming

Give a name to each place a color goes, once for light screens and once for dark screens.

Example"The background of a success message" is one name. It points to a dark green on a light screen and a different green on a dark screen.
Lesson 8
Part two · Make sure it gets usedSteps 9 to 13
9
Let a tool write the filesa tool does it

A program turns the names into the files the website uses. Nobody types them by hand.

ExampleYou change the green in one place. The tool rewrites every file that uses it.
Lesson 9
10
Write the rules downwriting

Describe each name and when to use it, so that people and tools can look it up.

ExampleShopify's Polaris documentation is this step. It is where the Shopify examples in this article came from.
Lesson 10
11
Build a checkerchecking

A tool that stops anyone from typing a color by hand when a name exists for it.

ExampleSomeone types the code for dark green. The checker stops it and says: use "success".
Lesson 11
12
Change the existing screens overreplacing

Go through the screens that already exist and replace every hand-typed color with its name.

ExampleA screen that has the code for dark green in forty places now says "success" in forty places.
Lesson 12
13
Look at every screenlooking

Open each screen, in light and in dark, and check with your own eyes that it looks right.

ExampleA success message that reads well on a light screen may be hard to read on a dark one. You only find out by looking.
Lesson 13

Lesson 2 · Decide where the colors are kept

Before a single token is written, decide three things: who edits the tokens, where the one true copy is kept, and which places need a copy of them.

step 1
Author
choose one
Design tool
Figma Variables, Tokens Studio, Penpot
Code editor
JSON written by hand or by an agent
Token platform
Supernova, Specify, Knapsack
Other tools may read; only this one writes.
→
step 2
Store
choose one
The design file itself
Figma as the record. No diff, no review.
Git repository
JSON, versioned, reviewed. The default.
Platform database
Supernova or Specify hold it.
The one place you would fix a mistake first. Everything after this is a copy.
⇨
step 3
Consume
as many desired
for output
Figma
variables synced back from the store
Docs
design-system.md, Storybook
Web CSS
variables.css, Tailwind theme
iOS · Android
Swift and Kotlin constants
All generated by a transformer from step 2. Nobody types these.
1 → 1 → many
One place people edit. One file that is the truth. As many outputs as you have platforms. The arrows run one way: step 3 never writes back to step 2, which is why generated files live in a folder nobody edits by hand.

Three decisions in order. One place where people edit, one place where the true copy is kept, and as many generated copies as there are places that need them.

Author. Choose one place where tokens get edited. It can be a design tool, a code editor, or a token platform. Every other tool may read. Only this one writes.

Store. Choose one place that holds the true copy. It is the place you would fix a mistake first. Everything after it is a copy.

Consume. Choose as many as you need: the design file, the documentation, the website's code, a phone app.

Lesson 3 · List the purposes

Colors on a screen are not decoration. Each color is there to tell the user something. Try starting by making a list with what your screens need to tell users. Each line on that list is one purpose: one job that color has to do on the screen.

Most screens have the same four purposes. The fifth is anything only your product needs.

  1. 1What is background. The page, the boxes, the lines, the writing. This is called the ground. It is usually a grey or an off-white, and everything else sits on it.
  2. 2What to press. One button on the screen is the main one. It gets its own color so your eye finds it. This is the main action.
  3. 3Action Response. After you do something, the screen tells you: it worked, be careful, or it failed. That is usually green, amber, and red.
  4. 4Something to know. A message that is not good news or bad news. It's just a plain note.
  5. 5Other considerations. A chart with six kinds of data needs six colors, one each. A calendar shared by four people might need one color per person. A map of train lines needs one color per line. These are things only your product has.
Payment details
Your spending this month, by kind. Check it, then save.
5
RentFoodTravel
4Note Payments are processed on weekdays.
3Saved Your changes are stored.
Check this The card expires next month.
Declined The bank refused this card.
2Save changesCancel
1

One ordinary screen with five numbered markers. A line joins each number in the list above to the same number on the screen. Marker 5 is on a bar chart with three colors for three kinds of spending. Marker 4 is on the blue message. Marker 3 is on the green, amber, and red messages. Marker 2 is on the filled button. Marker 1 is on the page behind the card.

Case Study: Shopify

Shopify is a company that makes software for running an online store. It publishes its design system, which is called Polaris, so anyone can read how its colors were decided. Shopify does not name its colors "green" or "red". It names them by what they tell the user, and it calls each one a color role. Its documentation says that every use of color is tied to a specific meaning, and that color is not used as decoration.

Here is Shopify's list next to the five purposes from this lesson. The numbers are the same ones as in the list and on the screen above.

From this lessonShopify's nameWhat Shopify uses it forColor
1What is backgroundDefaultThe whole screen: page, cards, textGrey and white
2What to pressBrandThe main buttonThe darkest grey
3Action ResponseSuccessThe action workedGreen
3Action ResponseCautionBe careful. Something needs the user's attentionYellow and orange
3Action ResponseCriticalAn error, or something is blockedRed
4Something to knowInfoTips and offersLight blue
5Other considerationsMagicFeatures that use artificial intelligencePurple
5Other considerationsEmphasisWhat is selected in an editorBlue

A table with eight rows. Each row has a numbered purpose from this lesson, the name Shopify gives it, what Shopify uses it for, and a swatch of the color. The names and color values come from Shopify's public Polaris documentation and token files at github.com/Shopify/polaris. Polaris also names a few roles for special places, such as form fields and the menu, which are left out here. Shopify uses yellow when it is not urgent yet and orange when it needs attention, and it gives the orange its own name, Warning. This lesson counts the two as one.

The next four examples are Shopify's own pictures. They come from its color documentation and show real parts of the screen a store owner uses. The numbers are added here and match the list in this lesson.

Example 1An order screen
A Shopify order screen. Two white cards on a light grey page. The first card has a yellow label that reads Unfulfilled, one product row, a white button that reads Fulfill item, and a dark grey button that reads Create shipping label. The second card has a green label that reads Fulfilled. 1233
1What is backgroundThe grey page and the white cards. Almost the whole screen is grey, white, and black.
2What to press"Create shipping label" is the one dark button. "Fulfill item" next to it is white, so it is not the main one.
3Action ResponseYellow "Unfulfilled" means not done yet. Green "Fulfilled" means done.

Example 1. A Shopify order screen with markers 1, 2, and 3. Two white cards on a grey page, a dark grey button, a yellow label, and a green label. Image © Shopify, from github.com/Shopify/polaris.

Example 2Messages after an action
A Shopify message with a green check icon that reads Your shipping label is ready to print, with a button that reads Print label.
3SuccessGreen. The action is done.
A Shopify message with an orange warning icon that reads The name of the city you're shipping to has characters that aren't allowed, with a button that reads Edit address.
3WarningOrange. Something needs attention.
A Shopify message with a red alert icon that reads High risk of fraud detected, with a button that reads Review risk analysis.
3CriticalRed. Something is wrong.

Example 2. Three Shopify messages, one per row, each with marker 3 and its meaning written beside it. The first has a green icon, the second an orange icon, and the third a red icon. Images © Shopify, from github.com/Shopify/polaris.

Example 3A plain note
A Shopify message on a light blue background that reads USPS has updated their rates, with a button that reads Update rates. Under it are four swatches of the blue used for it. 4
4Something to knowLight blue. "USPS has updated their rates." Nothing worked and nothing failed. It is news the store owner may want. The four boxes under it are the shades of blue Shopify uses for this kind of message.

Example 3. A light blue Shopify message with marker 4, and four swatches of blue under it. Image © Shopify, from github.com/Shopify/polaris.

Example 4Other considerations
A Shopify text editor. The first button in the toolbar is bright purple with a sparkle icon, and a small label above it reads Generate text. The other toolbar buttons are grey. 5
A Shopify store page editor. A row of three products, an armchair, a dresser, and a lamp, has a blue outline around it and a blue tab that reads Collection. 5
5MagicPurple. The "Generate text" button writes a product description with artificial intelligence. Shopify's rule is to use purple only for this, and not as decoration.
5EmphasisBlue. In the page editor, the blue outline and the blue "Collection" tab show which part of the page is selected right now.

Example 4. Two Shopify pictures, each with marker 5. The first is a text editor with one purple button in a grey toolbar. The second is a row of three products with a blue outline and a blue tab. Images © Shopify, from github.com/Shopify/polaris.

Lesson 4 · Ask the three questions and count

Your list of purposes says what the screens need to tell users. It does not say how many colors that takes. These three questions turn the list into a number of colors. Each question stops one common mistake.

Question 1How many versions does each purpose have?Stops two different messages from looking the same.

You take the list one line at a time and ask the question about that line. A version is one separate message that the user has to tell apart from the others. Most lines on the list have only one version. The background has one. The main button has one. Take "action response". A user presses Save on a payment form. The screen can answer in three ways. It worked: "Saved." Be careful: "The card expires next month." It failed: "The bank declined this card." Those are three versions. The user has to tell them apart at a glance, so each one needs its own color. Shopify has the same three.

General example
If you skip it
The card expires next month.
The bank declined this card.

Both are red. The user cannot tell which one is only a warning.

If you ask it
The card expires next month.
The bank declined this card.

Two versions, two colors. Be careful is amber. Failed is red.

Question 1, general example. Two small screens with the same two messages. In the first, both messages are red. In the second, one is amber and one is red.

Shopify exampleThree versions of Action Response
A Shopify message with a green bar across the top that reads Your shipping label is ready to print. Under it, on white: Your shipping label has been saved to your shipment. You can print it now, or later. A button reads Print label.
SuccessGreen. The shipping label was saved.
Part of a Shopify customer form with a phone number field. Under the field is a pale orange notice with a warning icon that reads Changing the phone number for this customer will unsubscribe them from SMS marketing text messages until they provide consent.
WarningOrange. Changing the phone number has a side effect the store owner should know about first.
A Shopify list of three products with prices. Two rows read 7 available and 4 available in plain grey text. The middle row reads 0 available in 3 locations on a pale red label.
CriticalRed. One product has none left to sell.

Answer: three. Action Response has three versions, so it needs three colors.

Question 1, Shopify example. Three parts of Shopify screens, one per row, each with its meaning written beside it. The first is a message with a green bar. The second is a form with a pale orange notice under a phone number field. The third is a list of three products where one has a pale red label. Images © Shopify, from github.com/Shopify/polaris.

Question 2Is each purpose shown with color?Stops you from using a color for everything.

Some things are shown another way. A heading is more important than the text under it, and that is shown by making the heading bigger and bolder. A button that cannot be pressed yet is shown fainter. Neither one needs a new color. Shopify's main button is a third example. It is the darkest grey, taken from the same grey as the background, so "what to press" did not need a new color there.

General example
If you skip it
Payment details
SaveNot ready

The heading is purple and the button that cannot be pressed is teal. Three colors, and the main button no longer stands out.

If you ask it
Payment details
SaveNot ready

The heading is bigger and bolder. The button that cannot be pressed is fainter. One color, and no new ones.

Question 2, general example. Two small screens with a heading and two buttons. In the first, the heading is purple, one button is blue, and one is teal. In the second, the heading is large and dark, one button is blue, and the other is the same blue but fainter.

Shopify exampleThe main button uses the grey
Part of a Shopify screen. A row of four buttons: Export, Import, and More actions are light grey, and Add product is dark grey. Above it is another dark grey button that reads Create shipping label. Under the row are four swatches of grey. AB
AThe main button"Add product" is the darkest grey. It stands out because it is darker, not because it is a different color.
BThe other buttons"Export", "Import", and "More actions" are a lighter grey from the same family.

Why this way? Shopify's documentation says its screens are black and white on purpose, so that anything in color stands out. Color is kept for meaning: green for success, orange for warning, red for critical. A blue or green main button would sit on every screen and compete with those. A dark grey button still stands out against a white card, and it leaves the colors free for the messages that need them. So "what to press" adds zero new colors.

Question 2, Shopify example. A Shopify picture with marker A on a dark grey button and marker B on a light grey button in the same row. Image © Shopify, from github.com/Shopify/polaris.

Question 3Does any purpose have a set of equals?Stops one of several equals from looking more important.

A set of equals is two or more versions of the same kind that are equally important. Two teams on a scoreboard. Four people on a shared calendar. Six kinds of data on a chart. Each one needs its own color, and no color may look stronger than the others, so you choose the colors together. Most products have no set of equals. Shopify has none, so both examples here are general ones.

General example 1
If you skip it
Team A · 2Team B · 2

The score is even, but Team A looks like it is winning.

If you ask it
Team A · 2Team B · 2

Two colors chosen together, equally strong. Neither team looks ahead.

Question 3, first general example. Two scoreboards with an even score. In the first, one team is strong red and the other is pale. In the second, the two teams are blue and orange of equal strength.

General example 2
If you skip it
MonAna · Dentist
TueBen · Class
WedAna · Gym
ThuBen · Dinner

Ana's events are strong blue and Ben's are pale. Ben's events look cancelled or less important.

If you ask it
MonAna · Dentist
TueBen · Class
WedAna · Gym
ThuBen · Dinner

Two colors chosen together, equally strong. You can tell whose event it is, and neither person's events look less important.

Question 3, second general example. Two shared calendars with four events, two for each person. In the first, one person's events are strong blue and the other's are pale. In the second, the two people have blue and orange of equal strength.

Then count

The answers to the three questions are the result. A color family is one color in all its shades, from light to dark. Green is one family. Red is another. Go down your list. If a purpose is shown with color, write down how many versions it has. If it is shown another way, write zero. Then add the numbers.

What the screens need to tell usersShopify
What is background1
What to press0, it uses the grey
Action Response3
Something to know1
Other considerations: features that use artificial intelligence1
Other considerations: what is selected in an editor1
Color families needed7

A table that adds up Shopify's color families, with a swatch of each color beside its number. Shopify's list comes to seven: grey, green, orange, red, light blue, purple, and blue.

Lesson 5 · Choose one color for each family

Choose one anchor per family

Next is choosing a color for each family. These are the only colors in the whole system that anyone picks by looking.

warm grey#817769the ground's temperature
blue#3D6BDAperson A, and the main button color
violet#7E55D0person B
green#22A25Epositive
sage#7A9C86steady
amber#DE9412caution
red#D93B32negative

From the project: its seven anchors, one color per family, each with what it is for.

Judge your anchors against what they are for. Do the colors for action response read in order from good to bad without a label? If some purposes are a set of equals, do they look like equals, or does one look more important? Is the ground warm or cool on purpose, or does it just look like a dirty white? Is the main action color one you would be happy to see on every button for two years?

Each anchor becomes a ramp

Take an anchor. Make lighter versions by raising the lightness in even amounts. Make darker versions by lowering it. Keep the hue the same. Then check that every text color can be read on every background it will sit on, in light mode and in dark mode.

neutral
0
50
100
200
300
400
500
600
700
800
900
950
blue
100
300
500
600
700
800
violet
100
300
500
600
700
green
100
300
500
600
700
sage
100
300
500
600
700
amber
100
300
500
600
700
red
100
300
500
600
700

Each family as a ramp. The outlined cell in each row is the anchor. The other cells are worked out from it.

Why a ramp has the steps it has

Not because five is a nice number. Every step exists because something on a screen needs it. Take one away and something stops working. Add one and nothing uses it.

100
A tinted fill - the background of a badge or an alert. Pale enough that dark text of the same family sits on it.
300
What carries the color in dark mode. The anchor itself sinks into a dark ground; this is the version that still reads.
500
The anchor. Icons, fills, chart marks on a light ground - anywhere the color is a shape rather than text.
600
Text and buttons on a light page. The anchor alone usually fails 4.5:1 against white; one step darker passes.
700
Text on the pale 100 fill - the badge's label. Dark enough to pass against its own family's tint.

Neutral gets twelve steps instead of five because it does more jobs: two page grounds, two card surfaces, borders, three levels of text, in two modes.

The five steps of a family, and the job each one does.

The neutral family gets twelve steps instead of five, because it does more jobs: two page backgrounds, two card backgrounds, borders, and three levels of text, each in two modes.

Who decides what

The designer decides the anchors. That is the taste. The ramps are arithmetic: even steps, the same hue, every pair checked for readability. A tool does that work, and it should be done again from scratch whenever an anchor changes. If a color looks wrong, change the anchor, not one step of the ramp.

What you can do now

Decide where your colors are kept: one place to edit, one true copy, and a copy for every place that needs one. List the purposes your screens have. Ask the three questions of each purpose and count how many color families that makes. Choose one color for each family. And answer the question that starts stage 3: how does one green become all the shades a screen needs?

Next · Stage 3 · Build the three tiers: making the shades for each color, then naming each color by its purpose, then naming where each color is used. Coming soon.

The design system series

  1. 1Introduction to design tokens13 min
  2. 2Preparing the tokens You are here18 min
  3. 3Build the three tiersComing soon
  4. 4Write it downComing soon
  5. 5Make it holdComing soon
  6. 6Take it into FigmaComing soon

Share this post

Written by Suzanne Sallaj

Product designer working on agentic AI, six years across healthcare, fintech and consumer.