Skip to content

v2.4.1 — the audit judges large systems' color tokens

Choose a tag to compare

@tpitre tpitre released this 29 Nov 22:25
· 5 commits to main since this release

Fixed

  • The design system audit judges large systems' color tokens. Variable naming and alias usage skip the primitive tier, which was taken to be the collection with the most raw values. In a big multi-mode system that's often the semantic theme collection: Primer's nine-mode theme holds the most raw values while being 72% aliases, so all 599 of its colors were skipped and the audit reported "No color variables to evaluate" at 100/100. The primitive tier is now a collection named as one (Primitives, _Primitives, Core, Globals, Tier 1, …, unless it's mostly aliases across modes), any variable named under a tier path (primitive/color/…), or an unnamed collection that's at least 80% raw, has one mode, and is stepped (blue/500, primary/100) or aliased into without role names. Palettes in their own library files count; hard-coded Light/Dark themes and semantic layers don't. Primer now reports 22 of 599 colors with visual names (its ANSI terminal colors). Alias usage scores change where the old rule excluded the wrong collection: Primer's moves from 98 to its actual 73%, Carbon's from 82 to 72 (its hard-coded breakpoint values now count).
  • Variable naming catches color/blue/500. Only the last segment was checked, so a scale step hid the color word, including in the check's own example. Trailing scale steps are skipped (500, A100, m, spaced Color / Blue / 500), and Radix, camelCase and lowercase hues are recognized (blueA/9, lightBlue/500, darkgray). Intent names that mention a color (text/onWhite, bg/neutralSubtle) and scheme names earlier in a path (label/coral/fgColor/active) aren't flagged.
  • When every color is in a primitive collection, the audit says so instead of "No color variables to evaluate".
  • Alias usage measures what it scores. Its details now report aliases among values outside the primitive tier (the ratio the score uses, not all values), its examples list only those tokens rather than palette colors, and a primitives-only library is reported as not applicable instead of failing at 0.

Docs

  • The audit's category weights on the MCP Apps page now match the scoring (Naming & Semantics 20%, Accessibility 15%), and the tools reference explains how the primitive tier is recognized.