Skip to content

fix(sidebar): fix @for layout, empty secondary divider, dark mode icons, active state (#608)#680

Open
giulio-leone wants to merge 1 commit into
italia:mainfrom
giulio-leone:fix/608-sidebar-multiple-problems
Open

fix(sidebar): fix @for layout, empty secondary divider, dark mode icons, active state (#608)#680
giulio-leone wants to merge 1 commit into
italia:mainfrom
giulio-leone:fix/608-sidebar-multiple-problems

Conversation

@giulio-leone

Copy link
Copy Markdown
Contributor

Fixes #608

Problems fixed

1. @for loop breaks sidebar layout
Custom <it-list-item> elements have display: inline by default, breaking the <ul> list layout. Added display: contents to :host(:not(li)) in list-item.component.scss so the inner <li> acts as a direct layout child.

2. Secondary divider visible when no secondary links
The .linklist-secondary wrapper always renders even when empty. Added CSS rule :not(:has(*)) to hide it when no secondary content is projected.

3. Dark mode icon colors
Icons inside the sidebar don't inherit the white text color in dark mode and turn blue on hover. Added ::ng-deep rules under :host(.theme-dark) to force icon color inheritance.

4. Active state styling
Active classes are correctly applied by the component; the visual issue was caused by Problem 1 (broken layout). Fixed by the display: contents solution.

Files changed

  • list-item.component.scss — Added :host(:not(li)) { display: contents; }
  • sidebar.component.scss — NEW: CSS for empty secondary + dark mode icons
  • sidebar.component.ts — Added styleUrls
  • sidebar.component.spec.ts — 15 new tests covering all 4 problems

Verification

  • ✅ 125/125 unit tests passing (double gate)
  • ✅ 0 lint errors (8 pre-existing warnings)
  • ✅ Lint-staged + commitlint passed

⚠️ This reopens #636 which was accidentally closed due to fork deletion.

…ns, active state (italia#608)

- Add display:contents to it-list-item host when not native li
- Hide empty secondary wrapper via CSS :not(:has(*))
- Fix dark mode icon color inheritance via ::ng-deep
- Add comprehensive test suite (15 tests covering all 4 problems)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

[Bug] Il componente <it-sidebar> ha diversi problemi

1 participant