Skip to content

15 dark status tokens were never inverted — they are byte-identical to their light values #951

Closed

Description

@thinkclay

bg.dark.muted is the single cause of 15 of the 17 contrast failures that exist in dark and not in light. Fixing that one token clears all of them.

Measured with the WCAG 2.1 formula over all 320 foreground/background token pairs in packages/ui/src/tokens/colors.ts, scoring light as a control so pre-existing failures are not reported as dark-mode findings.

The 15

Every status and interaction colour fails the 3:1 that WCAG 1.4.11 requires of UI components, against this one ground:

Ratio Needs Pair Same pair in light
2.62 3.0 icon[dark].active on bg.dark.muted 4.84
2.62 3.0 icon[dark].selected on bg.dark.muted 4.84
2.62 3.0 border[dark].active on bg.dark.muted 4.84
2.62 3.0 border[dark].selected on bg.dark.muted 4.84
2.62 3.0 border[dark].focus on bg.dark.muted 4.84
2.79 3.0 fg[dark].info on bg.dark.muted 4.54
2.79 3.0 icon[dark].info on bg.dark.muted 4.54
2.79 3.0 border[dark].info on bg.dark.muted 4.54
2.92 3.0 fg[dark].success on bg.dark.muted 4.34
2.92 3.0 icon[dark].success on bg.dark.muted 4.34
2.92 3.0 border[dark].success on bg.dark.muted 4.34
2.92 3.0 fg[dark].error on bg.dark.muted 4.33
2.92 3.0 icon[dark].error on bg.dark.muted 4.33
2.92 3.0 border[dark].error on bg.dark.muted 4.33
2.96 3.0 icon[dark].warning on bg.dark.muted 4.27

border[dark].focus is the one with teeth beyond aesthetics — a focus indicator below 3:1 against its adjacent ground is a WCAG 2.4.11 failure, and it is the only way a keyboard user can tell where they are.

They all pass comfortably in light, which is the tell: the ramps are fine, the ground is wrong. bg.dark.muted sits too close in luminance to the status colours that have to read against it.

Change

Darken bg.dark.muted. The warm near-black family already has darker steps to pick from, and the constraint is only that it stay distinguishable from bg.dark.subtle and bg.dark.default — the thing it exists to be is a recessed ground, so moving it away from the content colours is what it should have been doing anyway.

Re-run the audit after changing it rather than reasoning about the result; the script is in the #833 PR description and scores every pair in both themes.

packages/ui is a submodule, so this is its own PR there plus a pointer bump.

Acceptance

  • All 15 pairs above reach 3:1 or better in dark
  • bg.dark.muted is still visually distinct from bg.dark.subtle and bg.dark.default
  • No pair that passes today starts failing — the audit reports both directions

Note

Found by the #833 part-1 token audit. The remaining two dark-only failures are text[dark].quaternary on fg.dark.success and .error at 3.77:1 against the 4.5 needed for normal text; those are a separate shape of problem and are filed separately.

Activity

  1. added
    agent-ready
    redesign
    on Oct 2, 2026
  2. thinkclay commented on Oct 2, 2026

    @thinkclay
    ContributorAuthor

    Correcting this: my diagnosis was wrong. bg.dark.muted is not the cause, and darkening it cannot fix anything.

    The arithmetic rules it out. The tightest failing foreground is #1d7282 (primary[500] teal), which needs a ground luminance of ≤ 0.01303 to reach 3:1. bg.dark.subtle is already 0.0102 and bg.dark.default is 0.0060 — so "muted" would have to be darker than subtle to help, which inverts the ladder and destroys the thing muted exists to be. Even #241e18, close enough to subtle to be visually indistinguishable (1.06:1 apart), still only reaches 2.97.

    What is actually wrong

    15 of the dark status tokens are byte-identical to their light counterparts. They were never inverted for dark.

    token light dark
    fg.active / .selected #176476 #3fb5c7 inverted ✓
    fg.warning #a06f24 #c28d41 inverted ✓
    icon.active / .selected #1d7282 #1d7282 identical
    border.active / .selected / .focus #1d7282 #1d7282 identical
    fg / icon / border .info #2e72a0 #2e72a0 identical
    fg / icon / border .success #3a7d4c #3a7d4c identical
    fg / icon / border .error #b84f3b #b84f3b identical
    icon.warning #9a6614 #9a6614 identical

    The fix is already documented in the file, by whoever did half of it — the comment above fg.dark.active:

    Was primary[500] #1d7282 on both — only 3.38:1 against bg.dark.default, so active/selected state failed AA in dark mode. The teal ramp has to invert for dark: light steps carry, dark steps disappear into the ground.

    They applied that to the fg group's active/selected/warning and left icon and border behind, plus info/success/error across all three.

    The actual change

    Each stale token moves to the step its already-corrected sibling uses, or the 300 step where there is no corrected sibling:

    token group → worst ratio across all three dark grounds
    active / selected / focus primary[300] #3fb5c7 5.98
    info info[300] #7cb0d5 6.25
    success success[300] #74b480 5.94
    error error[300] #e58e80 5.89
    icon.warning warning[500] #c28d41 (matches fg.dark.warning) 4.97

    Re-running the audit after the change: 0 dark-only failures, down from 17. That includes #952's two — lightening the success and error fills fixes dark inverse text on them as a side effect, so #952 is resolved by this change too.

    No ground token is touched. bg.dark.muted stays as it is.

    Retitling to match. PR follows.

  3. changed the title [-]bg.dark.muted fails contrast against every status colour — 15 of the 17 dark-only failures[/-] [+]15 dark status tokens were never inverted — they are byte-identical to their light values[/+] on Oct 2, 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

    FrontendUXagent-readypriority: mediumredesign

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions