Skip to main content
Graphite UI

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.

Collections in the token snapshot
CollectionModesVariablestoken-drift
BreakpointSM (320px), MD (672px), LG–XL (1056–1312px), Max–Max plus (1584–1784px)4Checked
Breakpoint LG–XLLG (1056px), XL (1312px)4Checked
Graphite LayerDefault6Not checked
Graphite PrimitivesValue80Not checked
Graphite SemanticLight, Dark88Not checked
Graphite ThemeLight, Dark183Not checked
Graphite TypographyDesktop, Mobile65Checked
RadiusMode 18Checked
SpacingMode 114Checked
pnpm token-drift

The 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.