Skip to content

Inverse text on the dark success and error fills reaches only 3.77:1 #952

Closed
Scaffald/ui
#43

Description

@thinkclay

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.error so dark inverse text clears 4.5 — consistent with how the teal ramp already inverts for dark, and the comment above fg.dark.active explains that precedent ("the teal ramp has to invert for dark: light steps carry, dark steps disappear into the ground"). Check the ramps still read against bg.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

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

  1. added
    agent-ready
    redesign
    on Oct 2, 2026
  2. added 2 commits that reference this issue on Oct 2, 2026
    b52c120
    21daa87
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: lowredesign

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions