Case 02 · Cactus · Design system
Case 02 · Cactus · Design system
One system, three platforms
One system, three platforms
Cactus runs on three front-ends, built at different times by different people. The designs followed a shared library, but nothing tied that library to the code. Under delivery pressure, each front-end ended up hard-coding colour, type and spacing on its own. This is the audit, and the system that came out of it.
Cactus runs on three front-ends, built at different times by different people. The designs followed a shared library, but nothing tied that library to the code. Under delivery pressure, each front-end ended up hard-coding colour, type and spacing on its own. This is the audit, and the system that came out of it.
Company
Company
Role
Senior Product Designer · System lead since the audit
Role
Senior Product Designer · System lead since the audit
Team
1 designer · 8 developers
Team
1 designer · 8 developers
Surfaces
POS (Flutter) · Portal, Order and Pay (Next.js)
Surfaces
POS (Flutter) · Portal, Order and Pay (Next.js)
Status
In progress · v0.1
In progress
· v0.1
Status
In progress · v0.1
My contribution
My contribution
Audited the POS codebase (906 Dart files) and the shared widgets library.
Audited the POS codebase (906 Dart files) and the shared widgets library.
Defined the token model, the scope of v0.1 and the rules for changing it: no new raw values, and new tokens go through design.
Defined the token model, the scope of v0.1 and the rules for changing it: no new raw values, and new tokens go through design.
Planned the rollout with engineering, one platform at a time, starting with Order and Pay.
Planned the rollout with engineering, one platform at a time, starting with Order and Pay.
Not mine: Implementation in each codebase, by engineering.
Not mine: Implementation in each codebase, by engineering.
The problem
The problem
Three products, two frameworks, one designer, eight developers, and no shared source of truth between design and code.
Three products, two frameworks, one designer, eight developers, and no shared source of truth between design and code.
Three products, two frameworks, one designer, eight developers, and no shared source of truth between design and code.
The POS runs on Flutter for tablet and mobile. The account portal and Order and Pay run on Next.js. The screens followed a shared library, but nothing connected that library to the code: every value was typed by hand, and under delivery pressure the implementation drifted a little further with each release. Part of that debt was inherited too: screens from an earlier junior UI designer, styles lost in the move from Sketch to Figma, a portal built without a design file. The audit is where I stopped the drift and took ownership of the system.
The POS runs on Flutter for tablet and mobile. The account portal and Order and Pay run on Next.js. The screens followed a shared library, but nothing connected that library to the code: every value was typed by hand, and under delivery pressure the implementation drifted a little further with each release. Part of that debt was inherited too: screens from an earlier junior UI designer, styles lost in the move from Sketch to Figma, a portal built without a design file. The audit is where I stopped the drift and took ownership of the system.
The audit · POS app
The audit · POS app
What the code actually does.
What the code actually does.
Measured across the Flutter POS app, v1.10.9. These are the baseline every later number gets compared to.
Measured across the Flutter POS app, v1.10.9. These are the baseline every later number gets compared to.
Measured across the Flutter POS app, v1.10.9. These are the baseline every later number gets compared to.
199
199
distinct hex colours
distinct hex colours
927 uses across 275 files.
927 uses across 275 files.
30
30
near-identical light greys
near-identical light greys
#EEEEEE alone appears 190 times.
#EEEEEE alone appears 190 times.
32
32
font sizes
font sizes
Including 19.5. Weight is written nine different ways.
Including 19.5. Weight is written nine different ways.
47
47
corner radii
corner radii
From 1.5 to 110.
From 1.5 to 110.
53 / 70
53 / 70
spacing values off the 4-pt grid
spacing values off the 4-pt grid
Counting values up to 64.
Counting values up to 64.
108
108
button widgets
button widgets
58 public, 50 private, six naming prefixes.
58 public, 50 private, six naming prefixes.
Thirty light greys, all in use. Shown on white, at the values in the code.
ΔE < 5 · perceptually the same
ΔE < 5 · perceptually the same
EEEEEE
EEEEEE
F2F2F2
F2F2F2
E6E6E6
E6E6E6
FCFCFC
FCFCFC
F3E7E9
F3E7E9
EDEDED
EDEDED
FAFAFA
FAFAFA
F3F3F3
F3F3F3
F8F8F8
F8F8F8
F6F6F6
F6F6F6
F1F1F1
F1F1F1
F9F9F9
F9F9F9
E7E7E7
E7E7E7
F5F5F5
F5F5F5
FBFBFB
FBFBFB
F4F4F4
F4F4F4
F3F4F8
F3F4F8
FEF8F9
FEF8F9
E1E1E1
E1E1E1
F1F4F9
F1F4F9
F6F9FF
F6F9FF
F8F9FC
F8F9FC
F5F4F5
F5F4F5
F7F7F7
F7F7F7
EAEAEA
EAEAEA
E5E7EB
E5E7EB
F3F2F4
F3F2F4
F8F9FA
F8F9FA
FDF4F4
FDF4F4
F3F7F7
F3F7F7
The audit · shared library
The audit · shared library
The library and the code had drifted apart.
The library and the code had drifted apart.
99 colour tokens holding 89 distinct values, nine groups of exact duplicates, and names that meant different things in different places.
99 colour tokens holding 89 distinct values, nine groups of exact duplicates, and names that meant different things in different places.
99 colour tokens holding 89 distinct values, nine groups of exact duplicates, and names that meant different things in different places.
Same name, different value
Same name, different value
WARNING
WARNING
library #FAAD14
library #FAAD14
app #FFE58F
app #FFE58F
MAGENTA
MAGENTA
library #DD5AC9
library #DD5AC9
app #B60EDA
app #B60EDA
COLOR_ERROR_BG
COLOR_ERROR_BG
comment #FAFDFE
comment #FAFDFE
value #FFF1F0
value #FFF1F0
Different names, same value
Different names, same value
BLACK = pureBlack
BLACK = pureBlack
NATURAL_BLACK = offBlack
NATURAL_BLACK = offBlack
DIALOG_BLACK = shade1Black
DIALOG_BLACK = shade1Black
WHITE = pureWhite
WHITE = pureWhite
FRESH_GREEN = MINT_CREAM
FRESH_GREEN = MINT_CREAM
CHERRY_PIE = cherryPie
CHERRY_PIE = cherryPie
CAROUSEL_PINK = CLASSIC_ROSE
CAROUSEL_PINK = CLASSIC_ROSE
hi2Grey = hi3Grey
hi2Grey = hi3Grey
cherryCream = cBABAFF = c00AEEF
cherryCream = cBABAFF = c00AEEF
A type scale already existed: seven named sizes, from DISPLAY 25 to CAPTION 12.
Text set with the scale
Text set with the scale
~70
~70
Text set by hand
Text set by hand
1,811
1,811
Decisions
Decisions
Four calls that shaped v0.1.
Four calls that shaped v0.1.
Each one closes a gap that let the code drift away from the design.
Each one closes a gap that let the code drift away from the design.
Each one closes a gap that let the code drift away from the design.
01
01
Source of truth
Source of truth
Chose
Chose
Tokens in one file, generated into Flutter and Tailwind.
Tokens in one file, generated into Flutter and Tailwind.
Rejected
Rejected
A Figma-only library, with each codebase keeping its own constants.
A Figma-only library, with each codebase keeping its own constants.
Why
Why
A library that lives apart from the code falls behind as soon as delivery speeds up. One file that generates both can’t.
A library that lives apart from the code falls behind as soon as delivery speeds up. One file that generates both can’t.
02
02
Structure before values
Structure before values
Chose
Chose
Map today’s values to semantic roles and collapse duplicates first.
Map today’s values to semantic roles and collapse duplicates first.
Rejected
Rejected
A new palette at the same time.
A new palette at the same time.
Why
Why
Changing structure and values together turns every diff into a visual regression nobody can review. Even the contrast fix waits: the most used secondary-text grey (#9997A0, 246 references) reads at 2.9:1 on white, below WCAG AA. It lands in v0.2 as a one-token change.
Changing structure and values together turns every diff into a visual regression nobody can review. Even the contrast fix waits: the most used secondary-text grey (#9997A0, 246 references) reads at 2.9:1 on white, below WCAG AA. It lands in v0.2 as a one-token change.
03
03
Scope of v0.1
Scope of v0.1
Chose
Chose
Eight components, starting with the button.
Eight components, starting with the button.
Rejected
Rejected
A complete library before anyone adopts it.
A complete library before anyone adopts it.
Why
Why
108 button widgets show what happens without a shared component: every screen builds its own. Eight that ship beat eighty that wait.
108 button widgets show what happens without a shared component: every screen builds its own. Eight that ship beat eighty that wait.
04
04
Where to start
Where to start
Chose
Chose
Order and Pay: the smallest surface, Next.js, customer-facing.
Order and Pay: the smallest surface, Next.js, customer-facing.
Rejected
Rejected
The POS first, because it’s the biggest.
The POS first, because it’s the biggest.
Why
Why
Prove it in one release on a surface we can measure, then carry it to the portal and the POS.
Prove it in one release on a surface we can measure, then carry it to the portal and the POS.
Proposed · v0.1
Proposed · v0.1
One name, three outputs.
One name, three outputs.
A primitive holds the value. A semantic token says what it’s for. Each platform reads the same file.
A primitive holds the value. A semantic token says what it’s for. Each platform reads the same file.
A primitive holds the value. A semantic token says what it’s for. Each platform reads the same file.
Semantic token
Value
Flutter
Tailwind
surface/base
surface/base
#FAFAFA
#FAFAFA
context.c.surfaceBase
context.c.surfaceBase
bg-surface-base
bg-surface-base
surface/subtle
surface/subtle
#F2F2F2
#F2F2F2
context.c.surfaceSubtle
context.c.surfaceSubtle
bg-surface-subtle
bg-surface-subtle
border/default
border/default
#EEEEEE
#EEEEEE
context.c.borderDefault
context.c.borderDefault
border-default
border-default
text/primary
text/primary
#161515
#161515
context.c.textPrimary
context.c.textPrimary
text-primary
text-primary
state/warning
state/warning
#FAAD14
#FAAD14
context.c.stateWarning
context.c.stateWarning
bg-state-warning
bg-state-warning
Rollout
Rollout
One platform at a time.
One platform at a time.
01 · Pilot · in progress
01 · Pilot · in progress
Order and Pay
Order and Pay
Next.js. Tokens and the first components replace hand-written values on the guest flow.
Next.js. Tokens and the first components replace hand-written values on the guest flow.
02 · Next
02 · Next
Account portal
Account portal
Next.js with its own Tailwind library. The tokens become its theme.
Next.js with its own Tailwind library. The tokens become its theme.
03 · After
03 · After
POS app
POS app
Flutter, tablet and mobile. Generated constants replace CSAColors and CactusColors.
Flutter, tablet and mobile. Generated constants replace CSAColors and CactusColors.
What I took from it
What I took from it
A second source of truth becomes a third option.
A second source of truth becomes a third option.
Evidence before components.
Evidence before components.
Numbers from the codebase made the problem concrete for engineering in a way a redesign couldn’t.
Numbers from the codebase made the problem concrete for engineering in a way a redesign couldn’t.
Consolidation is a migration.
Consolidation is a migration.
Change the structure first and the values later, so every step can be reviewed.
Change the structure first and the values later, so every step can be reviewed.
Aligned screens weren’t enough.
Aligned screens weren’t enough.
The screens matched the library and the code still drifted. With eight developers and values typed by hand, consistency has to live in the code, not in the design file.
The screens matched the library and the code still drifted. With eight developers and values typed by hand, consistency has to live in the code, not in the design file.
Trust is the adoption metric.
Trust is the adoption metric.
A component gets used when people believe it matches production. Everything else follows.
A component gets used when people believe it matches production. Everything else follows.
How I’ll know
How I’ll know
Baselines I can measure in code.
Baselines I can measure in code.
The tokens, the generated Flutter and Tailwind outputs and the Figma library are built. Targets stay proposals until the Order and Pay pilot ships.
The tokens, the generated Flutter and Tailwind outputs and the Figma library are built. Targets stay proposals until the Order and Pay pilot ships.
The tokens, the generated Flutter and Tailwind outputs and the Figma library are built. Targets stay proposals until the Order and Pay pilot ships.
Measure
Measure
Today
Today
Target
Target
Screen files using colours without tokens
Screen files using colours without tokens
156 of 306
156 of 306
0 new
0 new
Primary buttons in parallel
Primary buttons in parallel
3
3
1
1
Font sizes in use
Font sizes in use
32
32
7-step scale
7-step scale
Distinct corner radii
Distinct corner radii
47
47
7-step scale
7-step scale
Screens reading the theme
Screens reading the theme
1 call to Theme.of
1 call to Theme.of
All
All
Keep reading
Keep reading
The other pieces.
The other pieces.
4 pieces · 3 cases, 1 concept
