Design Systems Token Vitals
Auditing what Discourse, the open source platform the community runs on, actually does in code, so a visual overhaul lands everywhere at once
design-token-vitalsGrades a front end’s design token layer, reports what it cannot prove, and ranks the fixes into a next move.
At a glance
Three results, one for each goal.
Reframing the opportunity
Not a consistency problem. A visibility problem: nobody could say which components a design change would reach until it shipped.
The platform’s code dates from 2013, before design tokens existed. Values had drifted across the platform, Raptive’s plugins and two style systems. Then a rebrand was scheduled, and it had to land everywhere at once.
Three goals:
- See what we have. Which tokens are real decisions, which are copies, and which nothing uses.
- Find why consistency breaks. Why some components ignore a changed value.
- Migrate safely. Which components move first, and why that order.
My approach
Read the code, not the design file
A scanner reads the real code and grades what it finds.
It follows every Sass and CSS import, separates Raptive’s code from the platform’s, merges duplicate definitions into one entry per decision and traces each to its files. It is open source: Design Token Vitals.
One value, four names
Vital · Single sourceWhite appears 76 times across 20 files, under four names. The brand purple too.
Renaming one leaves the others untouched. The values match; whether they mean the same thing is a person’s call, so the scanner flags them and never merges them.
- --background-inverse
- --mobile-background
- --mobile-secondary
- --brand-primary
- --icon-brand-primary
- --mobile-primary-blue
- --raptive-primary-blue
One button, 26 tokens
Vital · Tier integrityThe button pulls 26 tokens, 74 times, from more than one file.
Some read the named layer, some skip to the raw color, some read a mobile override. Of 369 rules that paint a button, 12 say enough to draw it. That is why “change the button color” was never a one-line job.

Rank by reach
87 components, ranked by the share of screens each one changes.
Desktop and mobile count as one screen. The button leads in code, at 8.7% of all token use, but appears on 22% of screens. The top navigation reaches 88%.
Foundational controls and visual primitives.
- Button22%
- Form field16%
- Validation message16%
- Avatar9%
- Badge9%
- Search field9%
- Select / picker9%
- Selection control9%
Small functional groups built from atoms.
- Filter controls34%
- Reaction bar19%
- Author row16%
- Action group13%
- Feed tabs13%
- Profile tabs9%
- Data visualization6%
- Metric card6%
Reusable interface regions and complex modules.
- Top navigation88%
- Bottom nav30%
- Composer16%
- Activity list13%
- Post card13%
- Sidebar11%
- Admin navigation9%
- Review nav9%

Grade only what is proven
Eight vitals. Four say “no evidence yet” instead of inventing a score.
A hatched track is a reading not taken, never a zero.
- Naming coherenceFour naming styles are in use where there should be one.fail
- Tier integritySome components skip the named token and use the raw value underneath.attention
- Coverage14 of 19 token groups were checked. Five were never measured.attention
- Single sourceThe same value answers to several different names.attention
- Leakage26 hard-coded colors match a token exactly; 163 more have no token at all.blocked
- Mode completenessThe built light and dark themes have never been checked.blocked
- OrphansWhich tokens nothing uses is still unknown.blocked
- EnforcementNothing in the build stops a hard-coded value getting in.blocked
One contract, two builds
One set of decisions, built natively in React and in the platform. Every format is generated from it.
CSS variables, Sass and Figma JSON all come from the one contract, so the two builds cannot drift again. The combined library is drafted: 909 tokens in 14 groups, not yet in production.
Button / Primary
background action.primary
foreground text.on-action
height size.control.medium
padding-inline space.md
radius radius.control
focus-ring focus
states default · hover · pressed
focus · disabled · loadingThe impact
A rebrand with an order, not a guess.
| Goal | Before | After |
|---|---|---|
| See what we have | Search 21 files, guess what a change reaches, ship and find out. | 105 components ranked, with the file and line of every use. |
| Find why consistency breaks | A change reaches some components and not others, found in QA or after launch. | Components read one named layer, so a change spreads for one reason instead of four. |
| Migrate safely | An order set by whoever asks loudest. | Buttons, type, spacing, color, then modes and accessibility, in measured order. |
What is proven, what is not
Proven
- 26 hard-coded colors that match a token and 163 that do not, each found at its file and line
- DM Sans and 17 brand colors confirmed from the real files, not from a spec
- A migration order based on measured use rather than on preference
Still open
- The built light and dark themes have not been checked yet
- Nothing in the build stops a hard-coded value getting in
- Whether those 163 values actually mean the same thing still needs a person to decide
- 70 tokens are still unsorted
- Whether this makes teams faster is unmeasured; the starting point is being recorded during rollout
None of this is specific to Raptive. The scanner reads any Sass and CSS front end, and the order needs no tool: measure the code, rank by evidence, write down what is unproven.