Repository navigation
Fix light-mode --accent-foreground contrast on --accent fill - #2760
Merged
Merged
Conversation
…2724) --accent-foreground was 240 4% 10% (near-black), copied from --secondary-foreground, sitting on --accent's dark 176 100% 24% fill: 3.40:1, below the 4.5:1 AA floor. Set it to 0 0% 100% (5.19:1), matching the near-white pattern every other light-mode --*-foreground already follows for a dark fill. Every text-accent-foreground call site pairs it with bg-accent (or --accent directly) in the same state selector (hover, focus-visible, focus, data-highlighted, data-state=open, or an unconditional variant fill) -- none rests on a non-accent surface, so none flips to unreadable light-on-light. Removes focus-treatment.test.ts's pinned 3.40:1 "known gap" assertion and its now-unused AA import, since the gap it recorded is closed. Co-Authored-By: Claude Sonnet 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.
Summary
Light-mode
--accent-foregroundwas240 4% 10%(near-black) — copied from--secondary-foreground, where it's correct because--secondary's fill is near-white. On--accent's dark176 100% 24%fill it's the opposite situation: dark text on a dark fill, 3.40:1, below the 4.5:1 AA floor.Every other light-mode
--*-foregroundinapp.cssfollows the documented rule (near-white text on a dark light-mode fill; near-black under.darkon a bright fill) —--accent-foregroundwas the one exception.Fix
Set light
--accent-foregroundto0 0% 100%, matching--destructive-foreground/--success-foreground/--warning-foreground. Yields 5.19:1, clearing AA. Dark mode was already correct (0 0% 98%on173 87% 27%, 4.58:1) and is untouched.Site audit
Checked every
text-accent-foreground/var(--accent-foreground)usage inpackages/desktop-app/src(16 files, ~25 call sites — Svelte components,.tsvariant definitions, andnoderef.css). Every single one pairstext-accent-foregroundwith abg-accent(orbackground: hsl(var(--accent))) in the same conditional/state selector —hover:,focus-visible:,focus:,data-[highlighted]:,data-[state=open]:, anisSelected &&conditional class, or an unconditional variant fill (active: 'bg-accent text-accent-foreground'). No site reststext-accent-foregroundon a non-accent surface, so none flips to unreadable light-on-light.Independently re-verified (fresh subagent, redid the search and the contrast math from scratch): confirms 3.4012:1 old / 5.1883:1 new, and the same 16-file/zero-regression result.
Test changes
focus-treatment.test.tshad a test pinning the old 3.40:1 ratio as a documented "known gap" (added by #2718, which explicitly didn't own this defect). Removed that test and its now-unusedAAimport, since the gap it recorded is closed.Docs
nodespace-docs/DESIGN.mdupdated separately (docs repo, direct commit per its own workflow): theaccent-foregroundtoken value in the frontmatter now matches, and the "known gap" paragraph is removed.Acceptance criteria
--accent-foregroundclears 4.5:1 against--accent(5.19:1)--*-foregroundrule (near-white in light, near-black in dark)text-accent-foregroundsite checked — none regressedfocus-treatment.test.ts's pinned assertion and "known gap" comment removedCloses #2724
Co-Authored-By: Claude Sonnet 5 [email protected]