Token Drift: Why Figma Variables and CSS Stop Matching
Your tokens pipeline is green and the brand still ships in two shades. Here are the 4 ways design tokens drift, and a 45-minute check that finds them.

You did the work. Colors, spacing and radii live as variables in Figma. A pipeline turns them into CSS custom properties. When a designer changes color/primary to #632ff7, a pull request lands, it merges, and the pipeline reports green.
Then someone opens checkout and the button is still the old purple, #7a4dff. So is the pricing page. Three components never picked up the change, because they never used the token. They used a copy of its old value.
The values in this post are illustrative. The method is real and works on your own tokens.
That is token drift: a design value and its code counterpart no longer agree, even though the system was built so they always would. This post covers the four ways it happens and a 45-minute check that finds every case in one collection of tokens. It is one of the five types of design system drift, and the one teams are most sure they have already solved.
Why a working pipeline doesn't prevent it
A tokens pipeline does one job well: it carries values from the design side to the code side. It does that in one direction, at the moment it runs, for the code that asks for a token by name.
It does not look at the code that stopped asking. A hardcoded hex value in a component file is invisible to the pipeline. So is a token that was renamed on one side and still referenced under its old name on the other. The pipeline succeeds because, from where it stands, there is nothing wrong.
So the question is not whether your pipeline works. It is what your code does with the tokens after the pipeline is done.
The four ways tokens drift
1. Hardcoded copies. A developer needs the brand color, the token has an unexpected name, the deadline is today, and #7a4dff goes straight into the file. It matches the design that day. It stops matching the next time the token changes, and nothing tells anyone. This is the most common kind, and the hardest to see, because the value looks right until it doesn't.
2. Values that diverged. The token exists on both sides under the same name, with different values. --space-4 is 16px in the design and 14px in the CSS, because someone adjusted it locally while the pipeline was broken one afternoon, and the next run never overwrote it.
3. Renamed tokens. radius/md became radius/medium in the design. The pipeline now generates --radius-medium. Code still asks for --radius-md, which no longer exists. In CSS, a var() that points at an undefined property, with no fallback, makes the whole declaration invalid when it is computed. The browser falls back to the inherited or initial value, so the corner silently becomes square. No error, no warning.
4. Modes nobody mapped. The design has a light and a dark mode. The dark value of a token changes, and only the light one is wired up in code. Everything matches in light mode, which is the mode everyone reviews in. Modes deserve their own post. For now, run the check below once per mode.
None of these is a mistake anyone would defend in review, and none is a person failing. Each is what happens when two copies of a value exist and nothing compares them.
The 45-minute token check
Start with one collection, usually colors, since that is where drift is most visible. You need the design file with the Variables panel open, the repository, and the product open in a browser with developer tools.
Step 1: list the design side (10 minutes). Open the Variables panel and select the collection. Write down each variable's name and its value for every mode. A two-column list is enough: color/primary #632ff7.
Step 2: list the tokens code defines (5 minutes). Find the file the pipeline writes to. Adjust src/styles to wherever yours lives:
grep -rhoE -- "--[a-z0-9-]+:" src/styles | tr -d ':' | sort -u > defined.txtThat is every custom property your code declares, one per line.
Step 3: find references to tokens that don't exist (5 minutes). List every token the code asks for, then keep only the ones nobody defines:
grep -rhoE -- "var\(--[a-z0-9-]+" src | sed 's/var(//' | sort -u > used.txt
comm -13 defined.txt used.txtEvery line of output is a renamed or deleted token that some component still uses. Those are the silent square corners.
Step 4: find the hardcoded copies (15 minutes). List every hex color written directly into a component, outside the tokens file:
grep -rnoE "#[0-9a-fA-F]{6}\b" src --include=*.css --include=*.scss --include=*.tsx --include=*.ts | grep -v "src/styles"Now compare each value with your list from step 1. A hardcoded value that matches a current token should use the token instead. A hardcoded value that matches an old token value is drift already: it is the brand color from before the last change. Your design file's version history shows what the old values were.
Step 5: read what the browser resolves (10 minutes). Open the product, open the console, and check the tokens that matter most:
const root = getComputedStyle(document.documentElement);
['--color-primary', '--space-4', '--radius-md'].map(name => [name, root.getPropertyValue(name).trim()]);An empty string means the token is not defined at runtime. A value that differs from step 1 means the two sides diverged. If a theme or mode is set on a different element, run it there instead of document.documentElement.
Put everything in one table:
| Token | Design | Code | Where | Kind |
|---|---|---|---|---|
color/primary | #632ff7 | #7a4dff | Button.module.css, PriceCard.tsx, Checkout.css | Hardcoded copy |
space/4 | 16px | 14px | tokens.css | Value diverged |
radius/md | renamed to radius/medium | --radius-md still used | Card.module.css | Renamed |
Illustrative rows. Yours will have your own values.
What to fix first
Fix in this order, because it follows how far each kind spreads:
- Renamed tokens. They break rendering quietly, and every new use of the old name adds another broken corner.
- Values that diverged on core tokens. Brand color, base spacing and type sizes touch every screen.
- Hardcoded copies of old values. They are already wrong. Replace each one with the token, not with the new hex.
- Hardcoded copies of current values. Right today, wrong at the next change. Replace them before that change comes.
For each row, find when the two sides last agreed. git log -S "#7a4dff" --oneline shows when a value entered the code; the one-afternoon audit walks through dating and ranking in more detail.
What a token check can't see
This check compares values. It does not compare what renders. A Button can use every right token and still be 4px taller than its design, because of padding set in a component, a line height that was never a token, or an icon slot that only exists on one side. That is a different kind of drift, and it needs a different check.
It also runs once. The next pull request can add a new hardcoded copy, and the table is out of date by the end of the week.
deeepSpace keeps both sides compared. Push your components with their styles and token usage through the Figma Plugin, sync your code with deeepCLI, and every comparison checks tokens, not just pixels, variant by variant. Start with Figma design system sync.


