Repository navigation
Inverse text on the dark success and error fills reaches only 3.77:1 #952
Description
Inverse text on a themed fill passes in light and fails in dark:
| Ratio | Needs | Pair | Same pair in light |
|---|---|---|---|
| 3.77 | 4.5 | text[dark].quaternary on fg[dark].success |
4.98 |
| 3.77 | 4.5 | text[dark].quaternary on fg[dark].error |
4.98 |
This is the pattern #820 moved five office sites onto. It was a clear improvement — the literal '#fff' they replaced scores about 1.9:1 on fg.dark.active, a bad failure — but text[theme].quaternary lands at 3.77 on the success and error fills, short of the 4.5 AA needs for normal text.
It passes 3:1, so it is compliant for large text (18pt+, or 14pt bold). Several of the real sites are badge labels at fontSize.xxs (11px), which is not large text.
Why it is narrow
Only success and error fail. The same inverse text on fg[dark].active and .selected scores well, because those invert to a light teal in dark (#3fb5c7) while success and error keep mid-range values:
fg.dark.success #... → 3.77 with text.dark.quaternary (#16110d)
fg.dark.error #... → 3.77
fg.dark.active #3fb5c7 → passes
Change
Pick one, in packages/ui/src/tokens/colors.ts:
- Lighten
fg.dark.success/fg.dark.errorso dark inverse text clears 4.5 — consistent with how the teal ramp already inverts for dark, and the comment abovefg.dark.activeexplains that precedent ("the teal ramp has to invert for dark: light steps carry, dark steps disappear into the ground"). Check the ramps still read againstbg.dark.*afterwards. - Or add a dedicated on-fill text token per fill, so each fill carries its own guaranteed-legible label colour rather than relying on one inverse token working against all of them.
The first is less machinery. The second is more honest about what the problem is: one token cannot be the correct label colour for every fill.
Acceptance
-
text[dark].quaternary(or its replacement) reaches 4.5:1 onfg.dark.successandfg.dark.error -
fg.dark.success/.errorstill reach 3:1 againstbg.dark.default,.subtleand.muted(see 15 dark status tokens were never inverted — they are byte-identical to their light values #951 —.mutedcurrently fails for both) - The five office sites changed in refactor(office): map 240 literal font sizes and the radii in features/office onto the tokens #820 are re-checked against whichever token wins
Note
Found by the #833 part-1 token audit, which scored all 320 foreground/background pairs in both themes. Dark mode is gated off until #840, so nothing is visibly broken in production today.
Activity
fix(tokens): invert the 15 dark status tokens that were never inverted (
chore(ui): bump the submodule for the dark status token fix (#951) (#955