Repository navigation
fix(theme): make the themes we author readable, and prove it - #708
Merged
Merged
Conversation
… proves it
Four of the five built-in themes shipped with text below the WCAG AA floor.
The review only caught two of them; running the arithmetic over all five found
33 failing pairs, not 8:
dark 0/21 already correct
high-contrast 0/21 already correct
nord 6/21
light 10/21
solarized-light 17/21
The default light theme put the menu bar, the status bar, keyboard hints and
every empty state at roughly 2.4:1 — `text-muted` on white is 2.54, and
nothing in this app is large enough to qualify for the 3:1 concession, because
the type scale runs 10px to 14px.
Every foreground moves along its own hue toward the surface it needs to escape
from, targeting ~4.9 so the values have somewhere to go before they fall back
under 4.5. For Nord and Solarized that means departing from the published
palettes. That is a real trade and it is deliberate: a theme named after a
palette is still a theme someone has to read, and both were using colours for
roles their canonical values do not survive — Solarized's `base1` as body text
on a light ground is 1.97:1.
Also here, because they are the same question:
- `brand-600` now carries white text in every theme (nord was 4.03, and
high-contrast, of all of them, was 3.56). Primary buttons still point at
`brand-500` in 38 places and that migration is its own change (#703) — this
only makes a correct rung exist to migrate to.
- One focus ring for the app instead of whatever each of three webviews draws
by default (#707), and reduced motion honoured at all (#704) — it was zero
rules out of 2,892.
- The status bar and the update chip take their status colours from the
semantic tokens rather than from `text-red-400` and friends. Those two were
the least readable things in the product at 2.74 and 1.49, and they are
where errors appear. The other 338 hardcoded colours are #706.
The test is the point. This was arithmetic over values already in the repo the
whole time, so there was never a reason for it to be a manual check — and it
was never done once. It asserts every foreground against every surface in
every built-in theme, that a brand rung can carry white text, and that a
theme's declared `base` matches how light its own surfaces are. Reverting any
single token fails it with the measured ratio in the message.
Measured in the running app: light theme went from 25 of 30 visible text
elements failing to 1, and the one left is `Run`, which is #703.
Closes #700, #704, #707.
Reverses the part of the previous commit that changed Nord's and Solarized's colours. That was the wrong call, made on a claim I had not checked: I wrote that both were "using colours for roles their canonical values do not survive", and for Solarized that is simply false. `base1` as light-mode secondary content is its documented role, straight from the palette's own table. What checking did turn up is that neither theme was fully canonical already — Solarized's `bg-tertiary` and `border`, and Nord's `brand-700`, are values this project invented, because neither palette defines a third surface. Most of the measured failures were against that invented surface. The real position is narrower and worth stating plainly: these palettes cannot meet WCAG AA and remain themselves. On Solarized's light grounds the only canonical members clearing 4.5:1 are its two darkest tones, so every accent it defines fails. Nord's Aurora red is 2.11:1 on Nord's own third Polar Night tone. That is what the palettes are, not a mistake in them. So themes now declare where their colours come from. `authored` is ours and is held to AA. `quoted` reproduces a published palette and is held to fidelity instead: the test asserts the values still match what the palette's author published, because the failure mode for a quoted theme is drift, and a "Solarized Light" corrected until it passed would be a name that no longer describes its contents. Their worst ratios are printed rather than asserted, so the cost stays in front of whoever reads the file. Nothing about this reaches the theme picker. Someone choosing Solarized can see Solarized — the swatches are right there, and if they don't like it they pick another one. An app that explained the contrast maths of a palette before letting you have it would be answering a question nobody asked. Two things fell out of this: - The app has had `contrastRatio` and `MIN_TEXT_CONTRAST` all along, wired into the theme editor to warn when a *user's* custom theme is unreadable. It was never once pointed at the five themes we ship, four of which failed. It also only checks `text-primary` on `bg-primary` — the most forgiving pair in the set, which the broken light theme passed at 14.68:1. - The test now uses those same helpers instead of reimplementing the maths, so it asserts against the function the UI already trusts.
This was referenced Sep 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Wave 1 of the UI review.
Closes #700, #704, #707.
What changed, and what deliberately didn't
Themes we author —
dark,light,high-contrast— are held to WCAG AA,enforced by a test. The default light theme had the menu bar, status bar,
keyboard hints and every empty state at roughly 2.4:1.
Themes we quote — Nord, Solarized Light — keep their published values,
untouched. An earlier revision of this PR darkened them. That was wrong, and it
was wrong on a claim I hadn't checked: I asserted Solarized was misusing its own
colours, when
base1as light-mode secondary content is its documented role.Checking properly turned up something more useful — neither theme was fully
canonical to begin with:
Most measured failures were against that invented third surface.
The honest position is narrower than "these palettes are broken": they cannot
meet AA and remain themselves. On Solarized's light grounds the only canonical
members clearing 4.5:1 are its two darkest tones — every accent it defines
fails. Nord's Aurora red is 2.11:1 on Nord's own third Polar Night tone. That is
what the palettes are.
How the test handles that
Themes declare an
origin.authoredis held to contrast;quotedis held tofidelity — the test asserts the values still match what the palette's author
published, because the failure mode for a quoted theme is drift. A "Solarized
Light" corrected until it passed would be a name that no longer describes its
contents.
Their real ratios are printed, not asserted:
Nothing about this reaches the theme picker. Someone choosing Solarized can
see Solarized — the swatches are right there, and if they don't like it they
pick another one. An app that explained the contrast maths of a palette before
letting you have it would be answering a question nobody asked.
Also here
brand-600now carries white text in every authored theme. Primary buttonsstill point at
brand-500in 38 places — that migration is [P2][a11y] Primary action buttons fail AA — white on accent is 3.22:1 at 12px #703; this makes acorrect rung exist to migrate to.
At 2.74 and 1.49 they were the least readable things in the product, and they
are where errors appear. The other 338 hardcoded colours are [P2][convention] 340 hardcoded palette colours in 46 files bypass the theme tokens #706.
The thing that stings
The app has had
contrastRatioandMIN_TEXT_CONTRASTall along, wired intothe theme editor to warn when a user's custom theme is unreadable. It was
never pointed at the five themes we ship, four of which failed. It also only
checks
text-primaryonbg-primary— the most forgiving pair in the set,which the broken light theme passed at 14.68:1.
The test now uses those same helpers rather than reimplementing the maths.
Verification
elements failing to 1 — and that one is
Run, which is [P2][a11y] Primary action buttons fail AA — white on accent is 3.22:1 at 12px #703text-mutedgives#9ca3af on #ffffff is 2.54:1, needs 4.5🤖 Generated with Claude Code