diff --git a/bootstrap/helpers/shared.php b/bootstrap/helpers/shared.php index f34a15aaf2..7ce429bfd1 100644 --- a/bootstrap/helpers/shared.php +++ b/bootstrap/helpers/shared.php @@ -4628,7 +4628,7 @@ function wireNavigate(): string } /** - * Registers a resource menu that the main sidebar shows in place of its main menu on wide screens + * Registers a resource menu that the main sidebar and the mobile drawer show in place of their main menu * (see components/navbar.blade.php). The menu teleports itself into #main-nav-context-{depth}. * Back on a menu shows the menu one depth lower, and Back at depth 0 shows the main menu. */ diff --git a/resources/css/app.css b/resources/css/app.css index ad9c56a420..4874b60767 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -2167,6 +2167,16 @@ html[data-theme="custom"]:not(.dark) :is(.application-settings-section, .applica } } +/* A resource menu that the main sidebar (and the mobile drawer) shows instead + (navbar #main-nav-context-{depth}). */ +.application-settings-navigation.in-main-nav { + display: none; +} + +.application-settings-navigation.in-main-nav ~ * { + grid-column: 1 / -1; +} + @media (min-width: 1280px) { /* Fixed like the main sidebar (3rem → bottom); left tracks its width (--sidebar-w). Fixed leaves the grid, so the content sibling is pinned to column 2 below. */ @@ -2193,15 +2203,6 @@ html[data-theme="custom"]:not(.dark) :is(.application-settings-section, .applica grid-column: 2; } - /* A resource menu that the main sidebar shows instead (navbar #main-nav-context-{depth}). */ - .application-settings-navigation.in-main-nav { - display: none; - } - - .application-settings-navigation.in-main-nav ~ * { - grid-column: 1 / -1; - } - html:not(.dark) .application-settings-navigation { --rail-fill: var(--coollabs-base); } @@ -6788,12 +6789,12 @@ html.dark .project-card-stats-dot { } } -/* Resource menu in the collapsed main sidebar: icons only. */ -.sidebar-collapsed .nav-context-menu :is(.menu-item-label, .nav-children, .menu-item > :not(.menu-item-icon)) { +/* Resource menu in the collapsed desktop sidebar: icons only (the mobile drawer never collapses). */ +.app-sidebar .sidebar-collapsed .nav-context-menu :is(.menu-item-label, .nav-children, .menu-item > :not(.menu-item-icon)) { display: none !important; } -.sidebar-collapsed .nav-context-menu .menu-item { +.app-sidebar .sidebar-collapsed .nav-context-menu .menu-item { justify-content: center; padding-left: 0; padding-right: 0; diff --git a/resources/views/components/application/configuration-sidebar.blade.php b/resources/views/components/application/configuration-sidebar.blade.php index 5d927443de..592c81e48f 100644 --- a/resources/views/components/application/configuration-sidebar.blade.php +++ b/resources/views/components/application/configuration-sidebar.blade.php @@ -227,11 +227,11 @@ @endphp @php - // The main sidebar shows this menu on wide screens (see components/navbar.blade.php). + // The main sidebar and the mobile drawer show this menu (see components/navbar.blade.php). registerMainNavContext(0, 'Dashboard', 'Back to the main menu'); @endphp -{{-- Rendered twice: in the page (below xl), and teleported into the main sidebar (xl and up). +{{-- Rendered twice: in the page (CSS hides it; it keeps the command palette items), and teleported into the main sidebar. navOnly renders only the sidebar copy, as the parent menu of a deeper page (e.g. a backup). --}} @foreach ($navOnly ? ['main-nav'] : ['page', 'main-nav'] as $placement) @if ($placement === 'main-nav') @@ -239,19 +239,15 @@