Guest favouriteCase study · Theming · BELLA, 2026
One system, many faces.
Themes in BELLA swap the values, never the components. A new brand or market is a token file, not a redesign. And it can’t ship below the contrast bar.
Per theme
- 9 rolesA theme changes what nine roles point to.
- 0 componentsSwitching theme touches zero components.
- 5 checksEvery theme passes the gate before it ships.
01The exhibit
Change the theme, not the code.
The same card in four themes, token by token: each tier 2 role points into tier 1, the tier 3 slots read the role, and the contrast gate checks the result. Point at a role to see where the card reads it.
Theme ground: BELLA · light
02In Storybook
One name, two answers.
Every component asks for a name that exists in every theme, so nothing falls back to light.
A component asks for background. Light mode answers white; dark mode answers near-black. The name never changes.
background{color.light.bg}#fffffftext-primary{color.light.ink}#121212text-muted{color.light.muted}#515151surface-card{color.light.panel}#f2f2f2focus-ring{color.brand.ochre-deep}#b97a14background{color.dark.bg}#0d0d0dtext-primary{color.dark.ink}#edededtext-muted{color.dark.muted}#b1b1b1surface-card{color.dark.surface}#161616focus-ring{color.brand.ochre}#e8a83e- the name never changes
03Decisions
Name the job, not the colour.
No component holds a colour of its own, so there’s no stand-in to forget.
- 01
The idea
Components only read meaning. A button reads action, never blue-600.
- 02
What shows it
Three themes, one component tree. Switching theme changes nine roles and touches zero components.
- 03
Why it matters
A new brand or market is a token file, not a redesign. And it can’t ship below the contrast bar.
// tier 2 · ground.tokens.json · the same names in every theme { "theme": "ground", "semantic": { "bg": "{neutral.0}", "panel": "{neutral.1}", "line": "{neutral.2}", "muted": "{neutral.5}", "ink": "{neutral.7}", "action": "{neutral.7}", "on-action": "{neutral.0}", "accent": "{brand.3}" } }
- A button reads action
04How it ships
From a token file to production, through a gate.
DTCG tokens in, CSS custom properties out. This is BELLA’s real pipeline, and every step runs on every change.
- write
tokens/*.json - build
build.py - generate
css · json · theme - check
the gate - ship
storybook + site
DTCG JSON files, in three tiers. It’s the only place anyone edits a value.
build.py turns the JSON into every output.
The CSS, the JSON, the Storybook theme and the token docs all come from the same files.
The gate fails the build if anyone hand-edits the generated tokens, if code and contract drift apart, or if a colour pair misses the contrast bar.
What passed the gate is what you see.
npm run buildgit diff --exit-code tokens/bella.css tokens/bella.json bella.dsds.yaml docs/bella.css docs/tokens.md .storybook/theme-values.json .storybook/public/favicon.svg src/assets/brand/favicon/favicon.svg .storybook/public/brand/bella-wordmark-ink.svgnode scripts/contract-parity.mjsnode scripts/contrast-pairs.mjsnode scripts/agents-md-check.mjsnpm run audit:visual
- action
The tokens are the source.
05The rules
What keeps themes honest.
The lessons from a client’s dark mode, written down so I don’t learn them twice.
- 01
Components never read tier 1.
A new need gets a new role.
- 02
Dark is a theme, not an inversion.
Muted text clears 7:1.
- 03
Colour lives in fills.
Text and lines stay ink or grey.
- 04
Every theme passes the gate.
AAA text, 3:1 controls.
- 05
The same names in Figma and code.
surface.panelin both.
06Reflection
Themes are a promise about names.
The hard part of theming isn’t the colours. It’s agreeing on what each role means, so a new brand can arrive without anyone opening a component file.
night, BELLA, dark
This is how I’d start with your system.
An audit, one component through the whole lifecycle, and a gate your team owns.
