Snapshots and drift
The checks compare the code with committed copies of the Figma kit, never with Figma itself. This page covers those copies and where the two are allowed to differ.
Token snapshot
The kit’s variables are extracted into docs/tokens/figma-snapshot.json, and token-drift compares the foundations in app/globals.scss against it on every pull request. It reads 5 collections, 95 variables in all.
| Collection | Modes | Variables | token-drift |
|---|---|---|---|
| Breakpoint | SM (320px), MD (672px), LG–XL (1056–1312px), Max–Max plus (1584–1784px) | 4 | Checked |
| Breakpoint LG–XL | LG (1056px), XL (1312px) | 4 | Checked |
| Graphite Layer | Default | 6 | Not checked |
| Graphite Primitives | Value | 80 | Not checked |
| Graphite Semantic | Light, Dark | 88 | Not checked |
| Graphite Theme | Light, Dark | 183 | Not checked |
| Graphite Typography | Desktop, Mobile | 65 | Checked |
| Radius | Mode 1 | 8 | Checked |
| Spacing | Mode 1 | 14 | Checked |
pnpm token-driftThe color collections are not part of the gate, because the engine computes color rather than declaring it. The engine is compared with the kit’s primitives below instead.
Dev Mode names
What Figma shows a developer who inspects a component.
docs/tokens/figma-code-syntax.json holds the seventy-nine variable names the kit's Dev Mode prints. token-drift fails unless each one is a --graphite-* variable the code declares, so the kit cannot hand out a name the code does not have. scripts/figma-code-syntax.js re-extracts it.
Color against the kit
The kit's swatches are bound to its variables. The engine computes six secondary stops slightly differently, and that is recorded rather than fixed.
What the checks cannot see
They read committed files, so they run offline. That has a cost.
Re-extracting a snapshot from Figma is a manual step. The checks catch the code drifting from a snapshot, not a snapshot drifting from Figma. A change made in the kit is invisible to CI until someone re-extracts and commits it. The Governance page covers all the checks.
