Back to Sentry

Token Taxonomy

.agents/skills/lint-fix/references/token-taxonomy.md

26.4.24.5 KB
Original Source

Token Taxonomy

Load this reference when manually fixing use-semantic-token violations.

Source of truth: static/eslint/eslintPluginScraps/src/config/tokenRules.ts

Token Categories and Allowed CSS Properties

CategoryKeywords in token pathAllowed CSS properties
contentcontent, linkcolor, text-decoration, text-decoration-color, text-emphasis-color, caret-color, column-rule-color, -webkit-text-fill-color, -webkit-text-stroke-color, fill, stop-color
backgroundbackgroundbackground, background-color, background-image
borderborderborder, border-color, border-top, border-right, border-bottom, border-left, all border-*-color variants, border-block*, border-inline*, stroke, text-decoration, text-decoration-color, border-image, border-image-source
focusfocus, elevationbox-shadow, outline, outline-color, text-shadow
graphicsgraphics, datavizbackground, background-color, background-image, fill, stroke, stop-color
syntaxsyntaxcolor, -webkit-text-fill-color, -webkit-text-stroke-color, background, background-color, background-image

Quick Lookup: CSS Property → Correct Category

CSS PropertyUse tokens from...
colorcontent (or syntax for code highlighting)
background, background-colorbackground (or graphics for data viz)
border, border-color, border-*border
box-shadowfocus
outline, outline-colorfocus
text-shadowfocus
fill, strokecontent (text), graphics (charts), or border (decorative)
text-decoration, text-decoration-colorcontent or border

Keyword Matching Strategy

Token paths like theme.tokens.interactive.chonky.neutral.content are matched by keyword:

  1. Split the path into segments
  2. Find which category keyword appears deepest (last) in the path
  3. That category's rule applies

Example: interactive.background.contentcontent wins (deeper than background).

Fix Pattern

When fixing a violation, keep the same specificity suffix and change only the category:

tsx
// Before (wrong: border token used for color)
color: ${p => p.theme.tokens.border.primary};

// After (correct: content token for color)
color: ${p => p.theme.tokens.content.primary};

If unsure which specific token name exists, check the theme definition or use your IDE's autocomplete on theme.tokens.<category>..