Suzanne Sallaj

Design systems · Stage 3 of 6 · Expanding on color roles

Expanding on color roles

By Suzanne Sallaj

· 18 min read · design system series, part 3

Two lessons on turning one chosen color into every shade a color role needs.

You are here

In this article, we will cover the following:

  1. Choose a shade for each part
  2. Organize for documentation

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

Part one · Make the systemLessons 6 and 7 shown
Lessons 1 to 5Covered in the first two articlesLearn the token vocabulary · Decide where the colors are kept · List the purposes · Ask the three questions and count · Choose one color for each family
6
Choose a shade for each partchoosing

Make the fill's family, its lighter and darker versions, then choose one for the background, the border, the icon, the words, the fill of a badge, and the words on it, and check each one for contrast.

ExampleShopify's success role uses green 3 behind a message and green 14 for its words.
Lesson 6
7
Organize for documentationrecording

Write the six choices down in one place: the purpose, the part, the green, and what it was checked against.

ExampleOne row reads: success, the words, green 14, checked against the background.
Lesson 7
Part two · Make sure it gets usedLessons 8 to 13
Lessons 8 to 13Coming in later articlesName 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
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 pale green on a light screen and a different green on a dark screen.
Lesson 8
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. The role descriptions in this article came from it; the color values came from Shopify's token files.
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 the strong 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 the strong 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

Article 2 ended with Shopify's nine color roles. Here they are again. Each role is named for what it tells the user, and each is known by its fill, the color Shopify puts on a small filled element. One purpose can hold several roles: success, caution, warning, and critical are four roles under the one purpose of action response.

Two small filled elements come up all through this article. A badge is the small colored label that shows the status of something, such as Paid. A banner is the message strip that runs across a page or a card.

Defaultgray 1 · #FFFFFFThe baseline for the whole admin, the screens store owners use to run their shop: pages, cards, text, and ordinary buttons.Article 2: What is background
Brandgray 15 · #303030Pulls focus to the main action when there are many choices.Article 2: What to press
Infoazure 9 · #91D0FFInformation worth noticing, like tips, promotions, or offers.Article 2: Something to know
Successgreen 12 · #047B5DAn action finished, or a status that is good and needs nothing.Article 2: Action response
Cautionyellow 6 · #FFE600Not urgent yet: incomplete or not-started statuses.Article 2: Action response
Warningorange 9 · #FFB800Needs attention. The strongest color that does not block.Article 2: Action response
Criticalred 12 · #C70A24The highest importance: impossible, blocked, or an error.Article 2: Action response
Magicpurple 12 · #8051FFArtificial intelligence or automation doing work for you.Article 2: Other considerations
Emphasisblue 13 · #005BD3What is selected or in focus in an editor.Article 2: Other considerations

Nine swatches, one per color role, each showing the role's fill. Under each: the role's name, the color and shade it comes from, its color code, what Shopify uses the role for, and the article 2 purpose it matches. The roles, fills, and meanings are from Shopify's published token files and its archived color documentation.

Nine roles come from the eight families of article 2 because Default and Brand share the gray family. Shopify lists four more roles for special places in the screen, such as the top bar and form fields. They are not about meaning, so this article leaves them out.

Now that a color has been chosen for each role, we can branch each one out and build on it. To show how one role grows, this article draws its own "Saved" message from Shopify's green family and gives it five greens across six parts. The strong green does two jobs, the icon and the fill of a badge.

Lesson 6 · Choose a shade for each part

1st - Making the family from the one green

The color role this article will focus on is success. At this point there is one green for it, the fill chosen in article 2: green 12, #047B5D, the strong green on Shopify's strong success badge and on the title bar of a success banner. One green is not enough to draw a message, so the first step is to make its family.

A family is the fill plus its lighter and darker versions. They are made by changing one thing only, how light the color is, in even steps from near white to near black, while the hue stays the same. A tool does it: Adobe Color's Shades rule or Adobe's Leonardo takes the one color you chose and returns the row. Shopify made sixteen for every color, and its documentation says the same shade number has the same lightness in every color. Here is its green row, with the fill marked.

green123456789101112Success13141516

Shopify's sixteen greens in one row, numbered from 1, the lightest, to 16, the darkest. Shade 12, #047B5D, is outlined and labeled Success. Values from Shopify's published token files.

2nd - Deciding colors based on the real estate

Choosing a green from the row for each part gets easier when you start with real estate: how much of the screen each part covers. A large area in a strong color takes over the screen and is hard to read on. A small area can be strong. So the background behind a success message is pale, and the icon, which is small, is strong.

Try itDrag the handle from right to left. The shape shrinks from a large panel to a small dot, and its green gets stronger as it shrinks.
Small real estateLarge real estate
green 3A large area, like the background of a message. The palest green, so it does not take over the screen.

An interactive drawing. A slider runs from small real estate to large. As it moves left, a wide pale green panel shrinks into a small dot and its green steps from shade 3 up to shade 12. A line under the slider names the current shade.

The background of a success message covers the most screen of any part, so it takes one of the palest greens. Shopify chose green 3. Against the gray page it is almost the same lightness, so it reads as a light tint.

#CDFED4
Success backgroundgreen 3 · #CDFED4Shopify describes it as "for backgrounds communicating success, like banners."Almost the same lightness as the gray page.

A large pale green panel labeled #CDFED4, beside its details: the success background, green 3 in Shopify's green family, Shopify's description of it, and its lightness against the page. Values from Shopify's published token files.

3rd - Adding foreground colors

Once the background is chosen, the next colors are the foreground colors: the ones that sit on top of it, like the words and the icon. In this example, we add the color for the words. Every foreground color has to be checked against the background it sits on. The standard check is WCAG, the Web Content Accessibility Guidelines. Its contrast rules exist so that a screen stays readable for people with low vision, people who have trouble telling some colors apart, and people whose eyes have changed with age. They also help anyone reading a phone in bright sunlight.

The measure is the contrast ratio, which compares how light two colors are: two identical colors are 1 to 1, and black on white is 21 to 1, the most there can be. WCAG has three levels, A, AA, and AAA. Level A has no rule for contrast. AA is the level most products aim for: small text needs at least 4.5 to 1 against what it sits on, and large text, icons, and the edges of controls people need to find, such as a text field, need 3 to 1. A border that only decorates has no minimum. AAA is stricter: small text needs 7 to 1. WCAG calls the words text, and sorts them into small and large.

You do not have to work the ratio out yourself. Adobe's free contrast checker does it for any two colors.

  1. Foreground color: paste the color of the words, for example the dark green #014B40.
  2. Background color: paste the color they sit on, for example the pale green #CDFED4.
  3. Read the ratio at the top, then the row for small text. Under AA it says Pass or Fail. Pass on that row means at least 4.5 to 1.

The words on the "Saved" message pass.

Contrast ratio9.0 : 1
Foreground color
#014B40
the words
Background color
#CDFED4
what they sit on
SavedYour changes are stored.
CategoryAAAAA
Large textPassneeds 3 : 1Passneeds 4.5 : 1
Small textPassneeds 4.5 : 1Passneeds 7 : 1
Graphics and UIPassneeds 3 : 1N/A

A drawing of Adobe's contrast checker with dark green #014B40 on pale green #CDFED4. The ratio reads 9.0 to 1, a preview shows the words Saved on the pale green, and every row in the table passes. The small text row is highlighted. Drawn for this lesson, not a screenshot of Adobe's page.

For the "Saved" message, dark green on pale green comes to about 9 to 1, an easy pass. The strong green #047B5D on the same pale green is about 4.7 to 1. That passes AA for small text with little to spare and fails AAA.

4th - Expanding to borders, icons, and others

Now that the background and the words have been chosen, the rest of the parts are easier still, because every one of them can be measured against the background. Building a family around contrast ratios is standard practice in design systems. Here are the targets this article uses for each part, measured against what the part sits on. The 3 and the 4.5 are WCAG's minimums. The 1 and the 1.1 are not rules from WCAG or Shopify; they keep the background and the border close to what they sit on.

  • Background: 1 to 1
  • Border: 1.1 to 1
  • Icon: 3 to 1
  • Words: 4.5 to 1
  • Badge fill: 3 to 1
  • Words on a strong badge: 4.5 to 1

The Undo button is not one of the five greens. It is white with dark gray words, and it is checked the same way. The background and the border are both under 3 to 1 on purpose. WCAG's 3 to 1 applies to parts a person needs in order to see or use something. Here the icon and the words carry the message, so the background and the border only add a tint and an edge.

These targets are not tied to green. If every color's shades are built so that shade 12 of red is as light as shade 12 of green, the same shade numbers give about the same contrast in every color, so once the targets work for green, they work for red and blue too. Here are the six parts of the "Saved" message and its badge measured against those targets.

134.5714
Backgroundagainst the page
1.0 to 1
Borderagainst the background
1.1 to 1
✓
Iconagainst the background
4.7 to 1
Saved
Wordsagainst the background
9.0 to 1
Paid
Badge fillagainst the page
4.6 to 1
Paid
Badge wordsagainst the strong green fill
5.2 to 1
The two orange lines are WCAG's minimums: 3 to 1 for icons and 4.5 to 1 for words.

Six rows, one per part of the "Saved" message and its badge: the background, the border, the icon, the words, the badge fill, and the words on the badge. Each row shows the part, what it is measured against, and a bar for its contrast. The two orange lines are WCAG's minimums, 3 to 1 for icons and 4.5 to 1 for words. Colors from Shopify's token files; the ratios were worked out for this article.

The result is a success message that says "Saved", built from Shopify's success greens. The Paid badge is drawn under the message, on the same page. Its fill is the strong green doing its second job, about 4.6 to 1 against the page, and its words are the fifth green, near-white on the strong green fill, about 5.2 to 1. The Undo button is white because, in Shopify's banners, the action button is always a white button, whatever the banner's color. Shopify's own success banner inside a card is simpler than this drawing: it has no border, and its icon is green 14, the same as its words.

✓
SavedYour changes are stored.
Undo
Order #1031Paid
a pale green behind it
a slightly stronger green around it
a strong green for the icon
a dark green for the words
a near-white green for the words on the strong green badge
the strong green again, for the fill of the badge

One "Saved" message drawn with six markers, a to f: the pale green background, the slightly stronger green border, the strong green check icon, the dark green words, and, on an order line under the message, a Paid badge with marker e on its near-white words and marker f on its strong green fill. The Undo button is white. A key under it shows each green as a swatch. Drawn for this article with colors from Shopify's green family.

The same targets work for any background color. Try one below.

Try itClick anywhere on the color wheel to choose a background, or enter a color code under it. The border, icon, and words are then built from it, each at its target contrast.

Pick a background

Your color #CDFED4
is the background

✓
SavedYour changes are stored.
Undo
PartColorAgainstContrastNeeds
Background#CDFED4page1.1 to 1about 1 to 1
Border#BBF2C4background1.1 to 1about 1.1 to 1
Icon#389A52background3.2 to 13 to 1 or more
Words#25512Ebackground8.2 to 14.5 to 1 or more
Button words#303030button13.2 to 14.5 to 1 or more

The Undo button stays white on every background.

The background is measured against the page. The border, the icon, and the words are measured against the background. The words on the button are measured against the button.

An interactive drawing. A color wheel on the left, and on the right a "Saved" message built from the chosen background, with a table of each part's contrast and the target it needs. The colors are worked out from the targets, not taken from Shopify.

5th - Optional: Adding more ways to display a color role

One way to show success is often not enough. A message that announces a finished order needs to be seen; a label that says an order is paid only needs to be read. The same greens can do both jobs at two levels of strength, a loud one and a quiet one. Shopify's success role is an example of how far this can go: it has two banners and two badges.

The two banners differ by where they sit. A banner on the page itself gets a strong green title bar with near-white words, green 12 and green 1, and a white body under it. A banner inside a card turns pale green all over, with a dark green icon and dark green words, green 3 and green 14. The loud one marks something new on the page. The quiet one sits inside content the reader is already looking at.

The two badges differ by how much they should stand out. The strong badge is filled with green 12 and has near-white words, green 1. The plain badge is filled with light green 4 and has dark green words, green 14, a fill Shopify describes as having "a secondary level of prominence". In the drawing, Paid gets the strong badge and Fulfilled gets the plain one. Each marker gives the number of the green used there, from 1, the lightest, to 16, the darkest.

If you add a second way, choose its greens the same way as the first: by real estate, then by contrast against what each part sits on.

On the page
✓Your shipping label is ready to print.
Your shipping label has been saved to your shipment. You can print it now, or later.
Print label
Inside a card
Order #1031
✓
Shipping label savedYou can print it now, or later.
Badges
Paid Fulfilled

A drawn page in three labeled parts. On the page: a banner with a green title bar (12), near-white words (1), and a white body with a white button. Inside a card: a pale green banner (3) with a dark green icon and words (14). Badges: Paid, filled green (12) with near-white words (1), and Fulfilled, light green (4) with dark green words (14). Drawn with Shopify's published values.

Lesson 7 · Organize for documentation

Lesson 7 writes the choices down. Lesson 6 made six decisions, which green goes on which part of the success message and its badge, and they exist nowhere yet except on your screen. Put them in one table, so the next article has something to document.

Each row carries the purpose, the part, and the green. The purpose comes first, because it is what holds the five greens together, and it is what will tell them apart from the rows for warning and critical when those roles are chosen the same way. The last column records what the green was checked against. If the background ever changes, it says which rows have to be checked again.

The purposeThe partThe greenChecked against
successBackground of the messagegreen 3 · #CDFED4the page
successBorder of the messagegreen 5 · #92FCACthe background
successThe check icongreen 12 · #047B5Dthe background
successThe wordsgreen 14 · #014B40the background
successThe fill of a strong badgegreen 12 · #047B5Dthe page
successThe words on a strong badgegreen 1 · #FAFFFBthe strong green fill, green 12
If you added a second way to show success in the 5th step, its greens go in the same table, one row each:
successTitle bar of a strong bannergreen 12 · #047B5Dthe page
successThe words on the title bargreen 1 · #FAFFFBthe title bar, green 12
successThe fill of a plain badgegreen 4 · #AFFEBFthe page
successThe words on a plain badgegreen 14 · #014B40the plain badge fill, green 4

A table with six rows, one per part of the "Saved" message and its badge, then a note and four more rows for the strong banner and the plain badge from the 5th step. Each row gives the purpose, success, then the part, its green with a swatch, its shade number and color code, and what it was checked against. Shade numbers and codes from Shopify's published token files; the border and icon are this article's choices.

For a designer, the simplest place is a page in the design file, next to the screens, with this table on it. If your team chose somewhere else in lesson 2, such as a spreadsheet or a plain text file, write it there instead. What matters is that there is one copy and everyone edits the same one. The next article turns each row into a name, and a tool turns the names into files.

What you can do now

Make a family from the role's fill with a tool, then choose a shade for each part: a pale one behind, a slightly stronger one around it, a strong one for the icon and for the fill of a badge, a dark one for the words, and a near-white one for the words on the badge, each checked for contrast against what it sits on. Write the six choices down in one table: the purpose, the part, the green, and what it was checked against. And answer the question that starts article 4: once the choices are recorded, how do they become names, and how do the names get into the files that screens are built from?

Next · Stage 4 · Write it down: a name for each color and each place it is used, a tool that turns the names into files, and the rules written where people and tools can read them.

The design system series

  1. 1Introduction to design tokens13 min
  2. 2Choosing the color roles19 min
  3. 3Expanding on color roles You are here18 min
  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.