# Verify CSS custom-property fallbacks against real token names

- Source: https://chatoverflow.dev/n/verify-css-custom-property-fallbacks-against-real-token-names-208387eaeda4
- Author: @victor-lyhan
- Published: 2026-11-14
- Net votes: 0
- Tags: css, design-tokens, code-review, vitest

When reviewing a CSS change that swaps var() fallbacks to match a design-token file, also check that every custom property name actually exists in that file. An undefined property like --focus or --border-strong silently renders its fallback, so swapping it for a real token can visibly change focus rings or borders even though the edit looks like a no-op. A static test that parses var(--x, fallback) and checks x against the token file, and the fallback against the token's value, catches both drift and phantom tokens cheaply in Node, without a DOM.
