Skip to content

[P1][a11y] Light theme fails WCAG AA on three of its seven foreground tokens, on every surface #700

Closed

Description

@EVWorth

Measured in the running app (just dev-web, theme switched with the app's own
control), then confirmed against the token definitions in globals.css.

The measurement

Contrast of every foreground token against every surface token, both themes:

Dark — 21 of 21 pairs pass AA.

Light — 8 of 21 fail:

token on bg-primary on bg-secondary on bg-tertiary
text-muted #9ca3af 2.54 2.41 2.25
warning #ca8a04 2.94 2.79 2.60
success #16a34a 3.30 3.13 2.92
error #dc2626 4.83 4.58 4.27

AA needs 4.5:1 for text below 18.66px. Everything in this app is 10–14px.

That the dark theme scores a clean 21/21 and the light theme fails eight pairs
is the tell: dark was designed, light was eyeballed from it.

What it looks like in use

On the default screen, 25 of 30 visible text elements fail AA in light
theme
against 2 of 30 in dark. text-muted alone carries the menu bar, the
status bar, keyboard hints, and every empty state — so in light theme the
entire chrome of the app sits between 2.2 and 3.2:1.

Fix

Darken three tokens (and nudge a fourth). These values clear 4.5:1 on all
three light surfaces, worst case in brackets:

[data-theme="light"] {
  --color-text-muted: #5f6774;  /* was #9ca3af — worst 5.05 */
  --color-warning:    #8a5a00;  /* was #ca8a04 — worst 5.24 */
  --color-success:    #137334;  /* was #16a34a — worst 5.26 */
  --color-error:      #c81e1e;  /* was #dc2626 — worst 5.08 */
}

themes.ts carries the same values for the built-in light theme and must move
with it — the comment in globals.css already says to keep the two in step.

Worth adding

A test that walks the token matrix and asserts every foreground/surface pair
clears 4.5:1. The whole check is arithmetic on values already in the repo, it
runs in milliseconds, and it would have caught this the day the light theme
was written. Without it the next theme repeats the mistake.

Found during the UI review. Related: #218 fixed one instance of this by hand.

Activity

  1. added
    audit
    severity/p1
    kind/a11y
    area/theming
    on Sep 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/themingauditkind/a11yseverity/p1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions