Brand Systems and Design Tokens
Turn a brand kit into a checked design system: tokens for colours, spacing and type, light and dark themes, and an audit that catches breaking changes, with real data and a real checker.
In this lesson you will
- Explain tokens and roles
- Write a design system as data
- Audit it for contrast and spacing
- Plan a dark theme and keep a system small
About 25 minutes
Fifteen people, one library, many purples
Meera’s reading club has become a library-wide programme. Now fifteen people make posters, slides, newsletters and social posts, and a new problem has appeared: the purple keeps changing. One person uses a slightly redder purple. Another has made a dark version of the Instagram post and kept the light-theme colours, so the purple text sinks into the dark background. Someone changed the spacing so nothing lines up with anything else. The brand kit from lesson 11 helped, but it is a shelf, not a rule book. At this scale you need a design system: a small set of named decisions that everyone uses, plus a way to check that they are used.
What a design system is
A design system is the brand kit grown up. It holds tokens, which are named values for the things that repeat: colours, spacing steps and type sizes. Instead of saying ‘use #5A28C8’, you say ‘use the primary colour’. Instead of ‘leave about 30 pixels’, you say ‘use the 32 step’. Naming matters because a name can stay the same while its value changes in one place. If the club later chooses a deeper purple, only the token changes and every design that follows the system changes with it.
Canva’s own Brand Kit area is built around the same idea. Its help pages describe stores for logos, colours, fonts and templates, colour themes that update colours together when you apply them, and brand controls that can limit a team to approved colours and fonts. Which of these you can use depends on your plan, and Canva’s wording and menus change, so look at your own account. The thinking in this lesson works whether or not you have those features, because the tokens can live in a plain document that everyone reads.
Tokens as data
Because tokens are just names and values, they can be written as data and checked by a program. The code below stores a small system in JSON, a plain text format for structured data. It has two colour themes, light and dark, a spacing scale and three type sizes. A function called audit then tests the system against three rules: every text and background pair that the theme uses must reach a contrast ratio of 4.5, every spacing step must be a multiple of 8, and body text must not be smaller than 32 pixels. Pay attention to which pairs it tests. In the light theme, text goes on the plain background, the purple goes on the plain background, and dark text goes on top of the pink accent. In the dark theme, the pink accent is used as text on the dark background. Each theme tests the pairs it really uses.
import json
def lum(h):
f = lambda c: c / 12.92 if c <= 0.03928 else ((c + 0.055) / 1.055) ** 2.4
r, g, b = (f(int(h[i:i + 2], 16) / 255) for i in (1, 3, 5))
return 0.2126 * r + 0.7152 * g + 0.0722 * b
def contrast(a, b):
hi, lo = sorted((lum(a), lum(b)), reverse=True)
return (hi + 0.05) / (lo + 0.05)
tokens = {
"colour": {
"light": {"bg": "#FFFFFF", "text": "#14112E", "primary": "#5A28C8", "accent": "#F06CC2"},
"dark": {"bg": "#14112E", "text": "#FFFFFF", "primary": "#B9A2F0", "accent": "#F06CC2"},
},
"spacing": [8, 16, 24, 32, 48, 64],
"type": {"body": 40, "heading": 62, "title": 78},
}
pairs = {"light": [("text", "bg"), ("primary", "bg"), ("text", "accent")],
"dark": [("text", "bg"), ("primary", "bg"), ("accent", "bg")]}
def audit(t):
problems = []
for theme, c in t["colour"].items():
for fg, bg in pairs[theme]:
r = contrast(c[fg], c[bg])
if r < 4.5:
problems.append(f"{theme}: {fg} on {bg} {r:.2f}")
if any(s % 8 for s in t["spacing"]):
problems.append("spacing not on the 8 grid")
sizes = sorted(t["type"].values())
if sizes[0] < 32:
problems.append("body text under 32")
return problems
text = json.dumps(tokens, sort_keys=True)
back = json.loads(text)
print("saved and reloaded the same:", back == tokens)
print("problems in version 1:", len(audit(tokens)))
v2 = json.loads(text)
v2["colour"]["dark"]["primary"] = "#5A28C8" # someone reuses the light-theme purple
v2["spacing"].append(50)
found = audit(v2)
print("problems in version 2:", len(found))
for p in found:
print(" -", p)
saved and reloaded the same: True
problems in version 1: 0
problems in version 2: 2
- dark: primary on bg 2.24
- spacing not on the 8 grid
Look at the results. The program first saves the tokens to text and reads them back, and confirms the result is identical, which is how you know the file is a faithful copy. Version 1 has no problems, so every pair passes in both themes. Then we simulate what goes wrong in real life. Someone makes version 2 and makes two small edits. They reuse the light-theme purple in the dark theme, and they add a spacing step of 50. The audit reports 2 problems: ‘dark: primary on bg 2.24’ and ‘spacing not on the 8 grid’. The purple on the dark background scores 2.24, far below 4.5, and 50 is not a multiple of 8. Neither mistake would be obvious on a quick look, but a check finds both in a moment.
Why two themes need two sets of colours
The dark theme is worth a moment. You cannot simply swap the background and keep the same colours. The dark purple you used for text on white is nearly invisible on a dark background, so the dark theme uses a lighter tint of the purple, as lesson 11 showed how to make. The pink accent goes the other way round: it fails as text on white but works well on the dark background. So tokens are not only names for colours, they also say which colour belongs in which job in which theme. Many systems call this a role: ‘text’, ‘background’, ‘primary’, ‘accent’.
Starting small
- Write your tokens: five colours with roles, a spacing scale, and three or four type sizes.
- Test every text and background pair you plan to use, in every theme you will make.
- Write the rules as a one-page guide with examples of right and wrong use.
- Save it in the brand kit if your plan allows, and in a shared document either way.
- Version it. Give each change a number and a short note, so that people can see what changed and why.
- Review it once a quarter and remove anything nobody uses.
Writing a system so large that nobody reads it. Ten colours, twenty text styles and forty rules will be ignored. A system people use is better than a perfect one they do not, so keep it to one page until you are certain more is needed.
A design system is for the people who make things, not for show. Test it by asking a new volunteer to make a poster using only the page. If they cannot, the page needs work, not the volunteer.
Practice for this lesson
Check what you learned
Five quick questions. Pick an answer and you will see straight away whether it is right and why.
What is a design token?
- A paid font
- A named value such as a colour or spacing step
- A photo filter
- A file type
Tokens give names to values that repeat, so one change updates everything that uses the name.
Why does a dark theme need its own colours?
- Dark themes use no colour
- Fonts change colour
- Canva requires it
- Colours that work on white may fail on dark
The purple that reads on white can sink into a dark background, so the dark theme uses a lighter tint.
What did the audit find in version 2?
- Low contrast and an off-grid spacing step
- A missing logo
- A broken font
- No problems
Reusing the light purple on dark and adding a step of 50 broke two of the rules.
Why save tokens to text and read them back?
- To make it smaller
- To change the colours
- To confirm the file is a faithful copy
- To delete old tokens
If the reloaded data equals the original, nothing was lost or changed in saving.
How big should a first design system be?
- A hundred pages
- Twenty themes
- No size
- One page
A short system that people actually read beats a perfect one they ignore.
Summary
- Tokens are named values for colours, spacing and type.
- Each theme needs colours that work for its own background.
- A program can audit a system and catch breaking changes.
- Keep the system small, versioned and tested on a newcomer.
Questions
Do I need a team to use a design system?
No. Even one person benefits from written tokens, because they make your own work consistent from one month to the next.
Can Canva enforce my tokens?
Canva's brand controls can restrict a team to approved colours and fonts, depending on your plan. Spacing and layout rules usually need a template or a checking habit.
Why use multiples of 8?
A small repeating scale makes gaps feel orderly. Eight is a common base because it divides cleanly and scales well, but any consistent base works.
