fix(sidebar): fix @for layout, empty secondary divider, dark mode icons, active state (#608)#680
Open
giulio-leone wants to merge 1 commit into
Open
Conversation
…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>
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.
Fixes #608
Problems fixed
1.
@forloop breaks sidebar layoutCustom
<it-list-item>elements havedisplay: inlineby default, breaking the<ul>list layout. Addeddisplay: contentsto:host(:not(li))inlist-item.component.scssso the inner<li>acts as a direct layout child.2. Secondary divider visible when no secondary links
The
.linklist-secondarywrapper 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-deeprules 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: contentssolution.Files changed
list-item.component.scss— Added:host(:not(li)) { display: contents; }sidebar.component.scss— NEW: CSS for empty secondary + dark mode iconssidebar.component.ts— AddedstyleUrlssidebar.component.spec.ts— 15 new tests covering all 4 problemsVerification