Skip to content
ssntl/ui

Color & contrast

Every pair of colors in the theme, measured in light and dark. Lint fails the build if one drops below WCAG AA, so this table only ever shows passing values.

Rules

  • Text needs 4.5:1 against its surface; large text (24px and up, or 19px bold) needs 3:1.
  • Input borders and the focus ring need 3:1, so a field is visible before anyone types in it.
  • A button's label is measured against its own fill, not the page: primary, secondary and accent all pass on their color.
  • Text on color uses a tint of white (white/80), never a neutral grey: grey on blue turns muddy and loses contrast.
  • Color never carries meaning alone: links are underlined, tags carry a word, errors carry a message.

Theme pairs

Computed from @ssntl/tokens at build time. The sample shows the real colors; the number is the contrast ratio.

Contrast of ssntl/ui token pairsWCAG 2.2 · Source: @ssntl/tokens
UseLightDarkMinimumResult
Text on the pageforeground / background17.5717.574.5AAA
Text on a cardforeground / card19.6716.144.5AAA
Muted text on the pagemuted-foreground / background5.9513.934.5AA
Muted text on a cardmuted-foreground / card6.6612.804.5AA
Muted text on a muted cardmuted-foreground / muted5.9512.044.5AA
Neutral tagmuted-foreground / secondary5.4310.694.5AA
Primary buttonprimary-foreground / primary19.6717.574.5AAA
Secondary buttonsecondary-foreground / secondary16.0513.474.5AAA
Accent buttonwhite / blue-6008.598.594.5AAA
Supporting text on brandwhite/80 / blue-6005.585.584.5AA
Destructive textdestructive / card5.844.674.5AA
Linkblue-600 · blue-300 / card8.599.484.5AAA
Live taggreen-600 · green-400 / secondary4.598.644.5AA
Input borderinput / background3.085.693.0Pass
Focus ringring / background7.677.213.0Pass