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. A shared library already existed. Nobody could trust it, so nobody used it. 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. A shared library already existed. Nobody could trust it, so nobody used it. This is the audit, and the system that came out of it.
Company
Company
Role
Senior product designer, system owner
Role
Senior product designer, system owner
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
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 and the scope of v0.1.
Defined the token model and the scope of v0.1.
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: [confirm] implementation in each codebase, by engineering.
Not mine: [confirm] 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. Hundreds of screens had their values written by hand. The Figma library never matched the code, and the move from Sketch to Figma lost the styles that were there.
The POS runs on Flutter for tablet and mobile. The account portal and Order and Pay run on Next.js. Hundreds of screens had their values written by hand. The Figma library never matched the code, and the move from Sketch to Figma lost the styles that were there.
The real problem
The real problem
Every new screen was a fresh decision about grey, radius and spacing, made by whoever was building it. Nobody was doing anything wrong. There was just nothing to be right against.
Every new screen was a fresh decision about grey, radius and spacing, made by whoever was building it. Nobody was doing anything wrong. There was just nothing to be right against.
Every new screen was a fresh decision about grey, radius and spacing, made by whoever was building it. Nobody was doing anything wrong. There was just nothing to be right against.
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 existed. It disagreed with itself.
The library existed. It disagreed with itself.
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 is a bet against the way the last library failed.
Each one is a bet against the way the last library failed.
Each one is a bet against the way the last library failed.
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 doesn’t match the code is exactly what already existed, and nobody used it.
A library that doesn’t match the code is exactly what already existed, and nobody used it.
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.
Changing structure and values together turns every diff into a visual regression nobody can review.
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 are what a library nobody adopts looks like. It multiplies, it doesn’t consolidate.
108 button widgets are what a library nobody adopts looks like. It multiplies, it doesn’t consolidate.
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
CTokens.surfaceBase
CTokens.surfaceBase
bg-surface-base
bg-surface-base
surface/subtle
surface/subtle
#F2F2F2
#F2F2F2
CTokens.surfaceSubtle
CTokens.surfaceSubtle
bg-surface-subtle
bg-surface-subtle
border/default
border/default
#E0E0E0
#E0E0E0
CTokens.borderDefault
CTokens.borderDefault
border-default
border-default
text/primary
text/primary
#161515
#161515
CTokens.textPrimary
CTokens.textPrimary
text-primary
text-primary
state/warning
state/warning
#FAAD14
#FAAD14
CTokens.stateWarning
CTokens.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 library nobody trusts adds a third option.
A library nobody trusts adds 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.
One designer can’t police consistency.
One designer can’t police consistency.
With eight developers and three platforms, the tokens have to do it.
With eight developers and three platforms, the tokens have to do it.
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.
Targets are what v0.1 is meant to move. They’re proposals until the pilot ships.
Targets are what v0.1 is meant to move. They’re proposals until the pilot ships.
Targets are what v0.1 is meant to move. They’re proposals until the 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
[target]
[target]
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
← Previous
Case 01 · Cactus · Live
How Much Is Left
How Much Is Left
How Much Is Left
One prepaid balance, read by the waiter and the guest at the same time.
Next →
Case 03 · Cactus · Live
Closing a shift without reopening it
Closing a shift without reopening it
Closing a shift without reopening it
Designing the state model before the screens, for venues with several registers.