fix(pwa): give the dark topnav its own button skin - #111
Merged
Conversation
The .btn skin is built for the light page ground (white fill, ink text).
The topnav rail is #101418, so those buttons landed there as stray
light-mode chips -- and ".bar a{color:var(--rail-text)}" outranks ".btn"
on color (0,1,1 vs 0,1,0), so <a class="btn">Settings</a> painted
rail-text on a white fill: 1.08:1, effectively invisible.
Scope a rail variant to .bar: transparent fill, rail-text label, and a
border at 38% rail-text (3.40:1, clearing the 3:1 non-text minimum --
--rail-line is only 1.4:1 and vanishes). Sign in keeps the green accent,
the focus ring moves green -> mint (3.60:1 -> 9.03:1), and .faint/.dim
in the bar resolve to --rail-dim.
Settings and Sign out go 1.08:1 and light-chip-on-dark to 17.20:1.
Body buttons are untouched -- every rule is .bar-scoped.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
vu1nz Security Review0 finding(s) in PR #? No security issues found. |
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.
The bug
.btninapps/pwa/src/lib/html.mjsis skinned for the light page ground — white fill, ink text, light border. The topnav rail is dark (--rail:#101418), and it had no button variant of its own, so those light-mode buttons were dropped straight onto it.Two distinct symptoms, matching the report ("washed out", "wrong theme color", "no contrast"):
1. Settings is invisible.
.bar a{color:var(--rail-text)}has specificity (0,1,1);.btn'scoloris (0,1,0). So.bar awins, and<a class="btn" href="/settings">Settings</a>renders#f6f7f4text on the#ffffffbutton fill:2. Sign out is the wrong theme. It's a
<button>, not an<a>, so it keeps ink text and stays legible — but it's a white light-mode chip sitting on a dark bar.Confirmed live:
curl https://app.logicsrc.com/serves exactly this CSS.The fix
A rail-scoped button skin, added right after the existing
.bar .brand .apprule. Every selector is.bar-scoped, so body buttons are untouched.--rail-line, 1.4:1 ❌.faint--rail-dim, 9.67:1 ✅The
38%border alpha isn't arbitrary — it's the floor that clears WCAG's 3:1 non-text minimum against the rail.--rail-line(the bar's own divider color) is only 1.4:1 and disappears entirely as a button outline. Both constants are commented in place.Sign indeliberately keeps the green accent:.bar .btn.acid(0,3,0) outranks.bar .btn(0,2,0), so the one intentional theme-colored button stays intentional.Verification
npm testinapps/pwa— 13/13 pass.appBar()through jsdom to resolve the actual cascade, not my reading of it. It confirms the root cause and the fix:a.btncolor comes from.bar abefore, andbutton.btnflipsvar(--text)→var(--rail-text)after, proving.bar .btn(0,2,0) beats.bar a(0,1,1).Screenshots weren't possible — the cached Chromium is missing
libatk-1.0.so.0and installing it needs sudo. Verification is cascade-resolution plus contrast math rather than a visual diff; worth an eyeball on the rendered bar before merge.🤖 Generated with Claude Code