Scope sidebar nav rules to the direct child nav (#211)

The sidebar rules matched every nav inside .sidebar, so a nested
tablist nav became fixed, column, sidebar-width. Use .sidebar > nav
in the component CSS, all style packs and sidebar.js.

Co-authored-by: grugbraindev <178141691+grugbraindev@users.noreply.github.com>
This commit is contained in:
Grug
2026-10-23 14:52:02 +08:00
committed by GitHub
co-authored by grugbraindev
parent 267ad687fa
commit 33a255b499
10 changed files with 263 additions and 263 deletions
+1 -1
View File
@@ -30,7 +30,7 @@
const handleClick = (event) => {
const target = event.target;
const nav = sidebarComponent.querySelector('nav');
const nav = sidebarComponent.querySelector(':scope > nav');
const isMobile = window.innerWidth < breakpoint;
if (isMobile && target.closest('a, button') && !target.closest('[data-keep-mobile-sidebar-open]')) {