Repository navigation
fix(tokens): invert the 15 dark status tokens that were never inverted - #43
Merged
Merged
Conversation
Every one of these was byte-identical to its light counterpart, so the dark
palette was wearing light-mode status colours:
icon.dark.active / .selected #1d7282 primary[500]
border.dark.active / .selected / .focus #1d7282 primary[500]
fg / icon / border .dark.info #2e72a0 info[500]
fg / icon / border .dark.success #3a7d4c success[500]
fg / icon / border .dark.error #b84f3b error[500]
icon.dark.warning #9a6614
All 15 failed the 3:1 that WCAG 1.4.11 requires of UI components, at 2.62-2.96
against bg.dark.muted. `border.dark.focus` at 2.62 is the one with teeth: a
focus indicator below 3:1 against its adjacent ground is a 2.4.11 failure, and
it is the only way a keyboard user can tell where they are.
The fix was already written down here by whoever did half of it, 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.
That was applied to the fg group's active/selected/warning and not to icon or
border, nor to info/success/error anywhere. This finishes it. Each token moves
to the step its corrected sibling uses, or the 300 step where it has none:
active / selected / focus primary[300] #3fb5c7 worst 5.98
info info[300] #7cb0d5 worst 6.25
success success[300] #74b480 worst 5.94
error error[300] #e58e80 worst 5.89
icon.warning warning[500] #c28d41 worst 4.97 (= fg.dark.warning)
"Worst" is across bg.dark.default, .subtle and .muted.
Scoring all 320 foreground/background pairs with the WCAG 2.1 formula, in both
themes so light failures are not miscounted as dark ones: 17 dark-only failures
before, 0 after. The two that were not in the 15 are inverse text on the success
and error fills, which clear 4.5:1 once those fills are lightened.
No background token is touched. The first theory was that bg.dark.muted was too
light, which the arithmetic rules out: the tightest foreground needs a ground
luminance of 0.01303, and bg.dark.subtle is already 0.0102, so "muted" would
have to be darker than subtle to help.
Checked for regression rather than assumed: only three places in the app use
fg[theme].success/error as a background — a progress fill, an 8x8 status dot,
and one icon that already uses text[theme].quaternary. Nothing puts white text
on either fill.
Scaffald/SaaS#951, and resolves Scaffald/SaaS#952.
Co-Authored-By: Claude Opus 5 <[email protected]>
thinkclay
added a commit
to Scaffald/SaaS
that referenced
this pull request
Oct 2, 2026
) Closes #951. Closes #952. Scaffald/ui#43 — 2f094f7ac..b52c1205a. 15 dark status tokens were byte-identical to their light counterparts, so the dark palette was wearing light-mode status colours: icon.dark.active/.selected and border.dark.active/.selected/.focus were all still primary[500] #1d7282, and info/success/error were the light values across fg, icon and border. Every one failed the 3:1 WCAG 1.4.11 requires of UI components, at 2.62-2.96 against bg.dark.muted. Scoring all 320 foreground/background pairs in both themes: 17 dark-only failures before, 0 after. #952's two are among them — lightening the success and error fills clears dark inverse text on those fills as a side effect. Note for #840: the first theory, filed on #951, was that bg.dark.muted was too light. That is wrong and the issue carries the correction. The tightest foreground needs a ground luminance of 0.01303 and bg.dark.subtle is already 0.0102, so no "muted" value can fix it without being darker than subtle. No background token changed. Verified on the bumped pointer: 2147 tests, 0 failures (scf-core 1282, ui 714, app 98, schemas 53), both submodule builds clean. Co-authored-by: Claude Opus 5 <[email protected]>
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.
Scaffald/SaaS#951. Also resolves Scaffald/SaaS#952.
What was wrong
15 dark status tokens were byte-identical to their light counterparts — the dark palette was wearing light-mode status colours:
icon.dark.active/.selected#1d7282border.dark.active/.selected/.focus#1d7282fg/icon/border.dark.info#2e72a0fg/icon/border.dark.success#3a7d4cfg/icon/border.dark.error#b84f3bicon.dark.warning#9a6614All 15 fail the 3:1 that WCAG 1.4.11 requires of UI components, at 2.62–2.96 against
bg.dark.muted.border.dark.focusat 2.62 is the one with teeth — a focus indicator below 3:1 against its adjacent ground is a 2.4.11 failure, and it is the only way a keyboard user can tell where they are.The fix was already written down here
Above
fg.dark.active:Whoever wrote that applied it to the
fggroup's active/selected/warning and stopped.iconandbordernever got it, andinfo/success/errornever got it anywhere. This finishes the job.Each token moves to the step its already-corrected sibling uses, or the 300 step where it has none:
bg.dark.default,.subtle,.muted#3fb5c7#7cb0d5#74b480#e58e80icon.warning#c28d41— matchesfg.dark.warningMeasured
All 320 foreground/background pairs scored with the WCAG 2.1 formula, in both themes so a pair that already fails in light is not reported as a dark finding:
The two outside the 15 are inverse text on the success and error fills (3.77:1, needed 4.5). Lightening those fills clears them, which is why SaaS#952 is resolved here too.
No background token is touched. The first theory was that
bg.dark.mutedwas too light; the arithmetic rules it out. The tightest foreground needs a ground luminance of ≤ 0.01303, andbg.dark.subtleis already 0.0102 — "muted" would have to be darker than subtle to help, which inverts the ladder and destroys what muted is for. Even a value visually indistinguishable from subtle only reaches 2.97.Regression check
Verified rather than assumed: only three places in the app use
fg[theme].success/.erroras a background — a progress-bar fill, an 8×8 status dot, and one icon that already usescolors.text[theme].quaternary. Nothing puts white text on either fill, so lightening them breaks nothing.Downstream suites, all against these values (SaaS#944 made the test tokens real rather than a stub): 2147 tests, 0 failures — ui 714, scf-core 1282, app 98, schemas 53.
Visibility
Dark mode is gated off in the app until SaaS#840, so nothing changes for users today. This is what makes it safe to land now and what #840 needs in place before it can verify screens in dark.