Skip to content

0.10.1: the nav button is readable without hovering - #44

Merged
ralyodio merged 1 commit into
masterfrom
worktree-nav-button-contrast
Sep 9, 2026
Merged

0.10.1: the nav button is readable without hovering#44
ralyodio merged 1 commit into
masterfrom
worktree-nav-button-contrast

Conversation

@ralyodio

@ralyodio ralyodio commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

The "Post a job" button in the header (and "Sign in" when logged out) was
unreadable unless you hovered it.

Cause: .nav a (0,1,1) outranks .btn (0,1,0), so the button rendered the
nav link's --muted-foreground on the button's own --primary background:

theme before after
light oklch L 0.53 on 0.52 = 1.05:1 4.89:1
dark oklch L 0.71 on 0.72 = 1.11:1 8.32:1

Hover only looked like a fix because .nav a:hover repainted the element as a
grey nav pill, discarding the button's background along with its own hover state.

Fix: scope the nav link rules with :not(.btn) so a button in the nav is left
to .btn, which already pairs --primary with --primary-foreground. One rule,
no new tokens, and future button variants in the nav inherit the right colours.

web/public/sw.js VERSION follows the shell asset hash (the suite asserts it), or
returning readers keep the old stylesheet.

Verified in Chrome against the real app.css in both themes; 119/119 tests pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_01969fmPKb5j3PUCdBRfCnbm

`.nav a` is one class and one element more specific than `.btn`, so the
header's "Post a job" and "Sign in" buttons took the nav link's
--muted-foreground on the button's --primary background. In light that is
oklch lightness 0.53 on 0.52, a contrast ratio of 1.05:1; in dark it is 0.71
on 0.72, 1.11:1. The label was there and invisible. Hovering appeared to fix
it only because `.nav a:hover` repainted the whole thing as a plain grey nav
pill, which also threw away the button's own hover state.

Excluding buttons from the nav link rules with `:not(.btn)` hands them back
to `.btn`, which pairs --primary with --primary-foreground: 4.89:1 light and
8.32:1 dark, and keeps the darker-green hover a button is supposed to have.

sw.js VERSION follows the shell asset hash, or returning readers keep the
old stylesheet.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01969fmPKb5j3PUCdBRfCnbm
@ralyodio
ralyodio merged commit dfc6ebd into master Sep 9, 2026
4 checks passed
@ralyodio
ralyodio deleted the worktree-nav-button-contrast branch September 9, 2026 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant