Design systems · Stage 3 of 6 · Expanding on color roles
Two lessons on turning one chosen color into every shade a color role needs.
In this article, we will cover the following:
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.
Learn what a design token is and the words used for its parts, so the rest of the steps make sense.
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.
Write down what your screens need to tell users. Each line is one purpose.
For each purpose: how many versions, is it shown with color, does it have a set of equals. Add up the color families.
Pick the one color that stands for each family. This is the only step you do by eye.
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.
Write the six choices down in one place: the purpose, the part, the green, and what it was checked against.
Give a name to each place a color goes, once for light screens and once for dark screens.
A program turns the names into the files the website uses. Nobody types them by hand.
Describe each name and when to use it, so that people and tools can look it up.
A tool that stops anyone from typing a color by hand when a name exists for it.
Go through the screens that already exist and replace every hand-typed color with its name.
Open each screen, in light and in dark, and check with your own eyes that it looks right.
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.
gray 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 backgroundgray 15 · #303030Pulls focus to the main action when there are many choices.Article 2: What to pressazure 9 · #91D0FFInformation worth noticing, like tips, promotions, or offers.Article 2: Something to knowgreen 12 · #047B5DAn action finished, or a status that is good and needs nothing.Article 2: Action responseyellow 6 · #FFE600Not urgent yet: incomplete or not-started statuses.Article 2: Action responseorange 9 · #FFB800Needs attention. The strongest color that does not block.Article 2: Action responsered 12 · #C70A24The highest importance: impossible, blocked, or an error.Article 2: Action responsepurple 12 · #8051FFArtificial intelligence or automation doing work for you.Article 2: Other considerationsblue 13 · #005BD3What is selected or in focus in an editor.Article 2: Other considerationsNine 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.
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.
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.
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.
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.
green 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.
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.
The words on the "Saved" message pass.
| Category | AA | AAA |
|---|---|---|
| Large text | Passneeds 3 : 1 | Passneeds 4.5 : 1 |
| Small text | Passneeds 4.5 : 1 | Passneeds 7 : 1 |
| Graphics and UI | Passneeds 3 : 1 | N/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.
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.
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.
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.
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.
Pick a background
Your color #CDFED4
is the background
| Part | Color | Against | Contrast | Needs |
|---|---|---|---|---|
| Background | #CDFED4 | page | 1.1 to 1 | about 1 to 1 |
| Border | #BBF2C4 | background | 1.1 to 1 | about 1.1 to 1 |
| Icon | #389A52 | background | 3.2 to 1 | 3 to 1 or more |
| Words | #25512E | background | 8.2 to 1 | 4.5 to 1 or more |
| Button words | #303030 | button | 13.2 to 1 | 4.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.
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.
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 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 purpose | The part | The green | Checked against |
|---|---|---|---|
| success | Background of the message | green 3 · #CDFED4 | the page |
| success | Border of the message | green 5 · #92FCAC | the background |
| success | The check icon | green 12 · #047B5D | the background |
| success | The words | green 14 · #014B40 | the background |
| success | The fill of a strong badge | green 12 · #047B5D | the page |
| success | The words on a strong badge | green 1 · #FAFFFB | the 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: | |||
| success | Title bar of a strong banner | green 12 · #047B5D | the page |
| success | The words on the title bar | green 1 · #FAFFFB | the title bar, green 12 |
| success | The fill of a plain badge | green 4 · #AFFEBF | the page |
| success | The words on a plain badge | green 14 · #014B40 | the 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.
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