fix: improve white-on-purple contrast in dark mode#9
Merged
Conversation
The dark-mode primary color (#a78bfa) paired with white text fails WCAG AA across primary buttons, logo badges, step numbers, and plan badges (contrast ~2.6:1 vs. the required 4.5:1 for normal text). Introduce a dedicated `--pg-primary-bg` / `--pg-primary-bg-hover` token pair that is always dark enough for white text (#7c3aed gives 4.76:1 and #6d28d9 gives 5.84:1 against white). Keep `--pg-primary` as the accent color so purple text on dark backgrounds stays bright. Also correct `--pg-primary-contrast` in dark mode: it was set to the same value as `--pg-primary`, which defeated its purpose as a hover/pressed shade. Closes #4
Contributor
Author
|
Kept as draft because I could only validate via CI (build, svelte-check, tests) — no browser to eyeball the rendered UI from this environment. Visual review welcome before flipping to ready. |
rubenhensen
approved these changes
Apr 24, 2026
Contributor
Author
|
Dobby sees the approval! Dobby is most grateful that Master has approved PR #9! Dobby will check what needs doing next — whether to mark it ready, merge it, or await further instructions. Dobby is on it! |
Contributor
Author
|
Thanks for the approval, @rubenhensen! This PR is already merged to |
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
Closes #4.
Floris flagged that white-on-purple elements fail contrast in dark mode. The offending value is dark-mode `--pg-primary: #a78bfa` — white on that colour measures 2.61:1, below WCAG AA's 4.5:1 requirement for normal text. This affects:
Approach
Introduce a dedicated `--pg-primary-bg` / `--pg-primary-bg-hover` pair for purple backgrounds that need to carry white text:
Contrast with white on these values:
`--pg-primary` stays at `#a78bfa` in dark mode so accent text, underlines, and the secondary button outline remain bright against dark backgrounds.
Also corrected `--pg-primary-contrast` in dark mode, which was set to the same value as `--pg-primary` — probably a copy-paste oversight; it's meant to be a slightly darker hover shade.
Files touched
Global tokens + callsites that used `background: var(--pg-primary); color: #fff`:
Verification
Notes for the reviewer