WCAG 2.1 contrast
verified at runtime.
Every --ax-text-* × --ax-background-* pairing is checked against the WCAG 2.1 formula
using resolved CSS custom properties. Flip theme in the panel (or press T) to re-run.
Thresholds: AA ≥ 4.5, AAA ≥ 7, non-text ≥ 3.
01Summary
Counts recompute when you flip the theme.
02Text on surfaces
All --ax-text-* × --ax-background-* combinations (threshold AA 4.5).
| Text token | Background | Sample | Colors | Ratio | AA | AAA |
|---|
03Button contrast
Button label on filled background for each role.
| Button | Text | Background | Sample | Ratio | AA | AAA |
|---|
04Alerts & status
Alert text (role-emphasis) on its faint background.
| Role | Text | Background | Sample | Ratio | AA | AAA |
|---|
05Border visibility
Non-text WCAG minimum is 3:1.
| Border | Surface | Demo | Ratio | ≥3 |
|---|
06How this works
Each cell's color and background are resolved through getComputedStyle. Relative luminance follows the WCAG 2.1 formula; contrast ratio is (L1 + 0.05) / (L2 + 0.05). Thresholds: AA normal text ≥ 4.5, AAA ≥ 7, non-text ≥ 3.