Add scripts/check-contrast.mjs, a plain Node script with no runtime
dependency and no test framework, that measures the WCAG 2.2 contrast
ratio of every theme token pair in the light and the dark theme.
- Read the light values from the :root block and the dark values from
the .dark block of public/src/main.css, the only stylesheet in the
build that declares the token values.
- Read the measured pairs from scripts/contrast-pairs.json, so the list
is reviewable next to the script. Every pair states its own threshold
and the harness rejects a threshold that disagrees with its category.
- Apply 4.5:1 for body text, 3:1 for large text and 3:1 for UI
component boundaries, and exit non-zero naming every pair below its
threshold with its token names, values, measured ratio and threshold.
- Report a token that is missing from a theme as a failure, not a skip.
Commit the measured table to docs/theme-contrast.md: 16 pairs, 32
measurements, 32 pass, 0 fail at commit 552d847.