Skip to content

Fix nav active state hidden by conflicting hover class#107

Merged
AdamJ merged 2 commits intomainfrom
copilot/fix-conflicting-colors-navigation-active-state
Apr 27, 2026
Merged

Fix nav active state hidden by conflicting hover class#107
AdamJ merged 2 commits intomainfrom
copilot/fix-conflicting-colors-navigation-active-state

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 27, 2026

bg-blue-200 on active NavLinks was silently overridden by the base hover:bg-accent class on hover, making the active indicator vanish. Also replaced the non-theme bg-blue-200 with the proper bg-accent token.

Changes

  • Navigation.tsx
    • Swapped bg-blue-200bg-accent for active state (theme-correct variable)
    • Moved hover classes out of the base string into the isActive conditional to eliminate Tailwind class conflicts
    • Active hover now uses hover:bg-accent/80 (dims the active bg) instead of hover:bg-accent (which was replacing it)
    • Extracted shared getNavLinkClasses(isActive: boolean) helper to deduplicate identical logic across Report and Settings NavLinks
// Before — hover:bg-accent in base overwrites bg-blue-200 on active links
`... bg-white hover:bg-accent hover:accent-foreground ... ${isActive ? 'bg-blue-200 hover:bg-accent hover:text-accent-foreground' : 'bg-white'}`

// After — state fully owned by the conditional; active hover is additive
`... border border-gray-200 hover:border-input ${isActive ? 'bg-accent hover:bg-accent/80 hover:text-accent-foreground' : 'bg-white hover:bg-accent hover:text-accent-foreground'}`

Copilot AI linked an issue Apr 27, 2026 that may be closed by this pull request
1 task
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying timetrackerpro with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4004974
Status: ✅  Deploy successful!
Preview URL: https://2cc4a4c6.timetrackerpro.pages.dev
Branch Preview URL: https://copilot-fix-conflicting-colo.timetrackerpro.pages.dev

View logs

Copilot AI changed the title [WIP] Fix conflicting colors on navigation active states Fix nav active state hidden by conflicting hover class Apr 27, 2026
Copilot AI requested a review from AdamJ April 27, 2026 13:20
@AdamJ AdamJ marked this pull request as ready for review April 27, 2026 13:34
@AdamJ AdamJ added fix For general fixes or bundled fixes accessibility labels Apr 27, 2026
@AdamJ AdamJ merged commit ebb70ad into main Apr 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accessibility fix For general fixes or bundled fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix conflicting colors on navigation active states

2 participants