Fix dropdown width: width: max-content on menu, width: 100% on items

- dropdown-menu: width: max-content (menu adapts to longest item)
- dropdown-item: width: 100% (items fill menu width)
- Same for submenu dropdown-menu
This commit is contained in:
2026-08-11 16:43:13 +02:00
parent 46c653eb21
commit 0137877439
3 changed files with 12 additions and 3 deletions
+4 -1
View File
@@ -82,13 +82,15 @@
margin: 0 !important;
min-width: 0 !important;
box-shadow: none !important;
width: max-content;
}
.dropdown-item {
color: var(--header-font) !important;
border-radius: 0 !important;
padding: 0.4rem 1rem;
white-space: nowrap;
width: auto;
display: block;
width: 100%;
}
.dropdown-item:hover, .dropdown-item:focus {
background-color: rgba(255, 255, 255, 0.1) !important;
@@ -322,6 +324,7 @@ pre code {
border: none !important;
border-radius: 0 !important;
box-shadow: none !important;
width: max-content;
}
.dropdown-submenu:hover > .dropdown-menu {
display: block;
+4 -1
View File
@@ -82,13 +82,15 @@
margin: 0 !important;
min-width: 0 !important;
box-shadow: none !important;
width: max-content;
}
.dropdown-item {
color: var(--header-font) !important;
border-radius: 0 !important;
padding: 0.4rem 1rem;
white-space: nowrap;
width: auto;
display: block;
width: 100%;
}
.dropdown-item:hover, .dropdown-item:focus {
background-color: rgba(255, 255, 255, 0.1) !important;
@@ -322,6 +324,7 @@ pre code {
border: none !important;
border-radius: 0 !important;
box-shadow: none !important;
width: max-content;
}
.dropdown-submenu:hover > .dropdown-menu {
display: block;
+4 -1
View File
@@ -121,6 +121,7 @@ $header-bg-opacity: 1;
margin: 0 !important;
min-width: 0 !important;
box-shadow: none !important;
width: max-content;
}
.dropdown-item {
@@ -128,7 +129,8 @@ $header-bg-opacity: 1;
border-radius: 0 !important;
padding: 0.4rem 1rem;
white-space: nowrap;
width: auto;
display: block;
width: 100%;
&:hover, &:focus {
background-color: rgba(255, 255, 255, 0.1) !important;
@@ -325,6 +327,7 @@ $header-bg-opacity: 1;
border: none !important;
border-radius: 0 !important;
box-shadow: none !important;
width: max-content;
}
// Open submenu on hover (desktop)