Skip to content

Fix SidebarLink hover state broken in dark mode #6868

@talissoncosta

Description

@talissoncosta

Problem

Hovering a sidebar navigation item in dark mode only changes the icon colour to purple. The text stays white and there is no background highlight. In light mode, hovering changes both icon and text to purple.

Root cause: SidebarLink.tsx uses CSS classes hover-fill-primary and hover-bg-primary that do not exist anywhere in the SCSS. The class that does exist is hover-color-primary (web/styles/project/_utils.scss:9), which handles text colour + child colour + SVG path fill on hover.

Light mode appears to work by coincidence — the text colour change comes from anchor/NavLink default styles, not from the missing utility classes.

Bugs (3 in one file)

Line Code Issue
35 hover-fill-primary hover-bg-primary Non-existent CSS classes — should be hover-color-primary
31 inactiveClassName={activeClassName} Copy-paste bug — inactive NavLinks receive active class styles
42 fill={'#767D85'} Hardcoded icon fill overrides any CSS-based fill class

Files

  • web/components/navigation/SidebarLink.tsx

Proposed Fix

  1. Line 35: Replace hover-fill-primary hover-bg-primary with hover-color-primary
  2. Line 31: Change inactiveClassName={activeClassName} to inactiveClassName={inactiveClassName}
  3. Line 42: Remove fill={'#767D85'} so the icon inherits colour from the CSS class

Acceptance Criteria

  • Sidebar hover works correctly in both light and dark mode
  • Inactive NavLinks no longer receive active class styles
  • Icon colour adapts to theme via CSS inheritance, not hardcoded hex
  • npm run typecheck passes
  • npx eslint --fix passes

Context

Part of the design system audit (#6606). See frontend/DESIGN_SYSTEM_ISSUES.md on chore/design-system-audit-6606 branch for full issue list (QW-9).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions