Skip to content

Commit 0cb6f5e

Browse files
authored
css: display main menu on mobile only (#23147)
Display the main menu widget only on smaller widths & touch up appearance. <img width="272" height="206" alt="Screenshot 2025-07-24 at 11 02 21" src="https://github.com/user-attachments/assets/f7ad62cc-b513-4185-8ab7-727cc698fb1b" />
1 parent 83d589d commit 0cb6f5e

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

layouts/partials/sidebar/mainnav.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
-}}
88
<!-- Main navigation for the sidebar -->
9-
<div class="px-4 py-2" x-data="{ expanded: false }">
9+
<div class="px-2 py-4 md:hidden text-gray-700 dark:text-gray-200 card " x-data="{ expanded: false }">
1010
<div class="flex w-full items-center justify-between">
1111
<!-- Current section: use menu, fall back to current section or page -->
1212
{{- $curr := .FirstSection }}
@@ -31,7 +31,7 @@
3131
</a>
3232
<button
3333
@click="expanded = !expanded"
34-
class="rounded-sm hover:bg-gray-300 hover:dark:bg-gray-300"
34+
class="rounded-sm hover:bg-gray-200 hover:dark:bg-gray-800"
3535
>
3636
<span x-show="! expanded" class="icon-svg">
3737
{{ partialCached "icon" "arrow_drop_down" "arrow_drop_down" }}
@@ -58,4 +58,4 @@
5858
{{ end }}
5959
</ul>
6060
</div>
61-
<hr class="m-2 text-gray-200 dark:text-gray-500" />
61+

layouts/partials/sidebar/sections.html

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@
88
*/
99
-}}
1010
<!-- section tree -->
11-
<nav class="navbar-font flex flex-col">
12-
<div class="block py-4 text-gray-200 md:hidden dark:text-gray-200">
13-
This section
14-
</div>
11+
<nav class="navbar-font flex flex-col mt-1 mx-1">
1512
<ul>
1613
{{ template "renderChildren" .FirstSection }}
1714
</ul>

0 commit comments

Comments
 (0)