From 942393f7f9fd83ac6def0d038f97fe2024e41940 Mon Sep 17 00:00:00 2001 From: Edwin Noorlander Date: Tue, 11 Aug 2026 16:30:26 +0200 Subject: [PATCH] Override Bootstrap dropdown CSS variables completely: no borders, no radius, no shadow, auto-width - Set --bs-dropdown-min-width: 0 (width adapts to content) - Set --bs-dropdown-border-width: 0 (no borders) - Set --bs-dropdown-border-radius: 0 (no rounded corners) - Set --bs-dropdown-box-shadow: none (no shadow) - Set --bs-dropdown-padding-x/y: 0 (no padding) - white-space: nowrap and width: auto on dropdown-item - Same overrides on submenu dropdown-menu --- themes/default/assets/css/theme.css | 14 +++++++++++++- themes/default/assets/css_compiled/theme.css | 14 +++++++++++++- themes/default/assets/scss/theme.scss | 16 ++++++++++++++-- 3 files changed, 40 insertions(+), 4 deletions(-) diff --git a/themes/default/assets/css/theme.css b/themes/default/assets/css/theme.css index 1aa63e4..43eb37a 100644 --- a/themes/default/assets/css/theme.css +++ b/themes/default/assets/css/theme.css @@ -69,18 +69,26 @@ } .dropdown-menu { + --bs-dropdown-min-width: 0; + --bs-dropdown-padding-x: 0; + --bs-dropdown-padding-y: 0; + --bs-dropdown-border-width: 0; + --bs-dropdown-border-radius: 0; + --bs-dropdown-box-shadow: none; background-color: var(--header-bg) !important; border: none !important; border-radius: 0 !important; padding: 0 !important; margin: 0 !important; min-width: 0 !important; + box-shadow: none !important; } .dropdown-item { color: var(--header-font) !important; border-radius: 0 !important; - padding: 0.5rem 1rem; + padding: 0.4rem 1rem; white-space: nowrap; + width: auto; } .dropdown-item:hover, .dropdown-item:focus { background-color: rgba(255, 255, 255, 0.1) !important; @@ -310,8 +318,12 @@ pre code { margin-top: 0; margin-left: 0; display: none; + --bs-dropdown-border-width: 0; + --bs-dropdown-border-radius: 0; + --bs-dropdown-box-shadow: none; border: none !important; border-radius: 0 !important; + box-shadow: none !important; } .dropdown-submenu:hover > .dropdown-menu { display: block; diff --git a/themes/default/assets/css_compiled/theme.css b/themes/default/assets/css_compiled/theme.css index 1aa63e4..43eb37a 100644 --- a/themes/default/assets/css_compiled/theme.css +++ b/themes/default/assets/css_compiled/theme.css @@ -69,18 +69,26 @@ } .dropdown-menu { + --bs-dropdown-min-width: 0; + --bs-dropdown-padding-x: 0; + --bs-dropdown-padding-y: 0; + --bs-dropdown-border-width: 0; + --bs-dropdown-border-radius: 0; + --bs-dropdown-box-shadow: none; background-color: var(--header-bg) !important; border: none !important; border-radius: 0 !important; padding: 0 !important; margin: 0 !important; min-width: 0 !important; + box-shadow: none !important; } .dropdown-item { color: var(--header-font) !important; border-radius: 0 !important; - padding: 0.5rem 1rem; + padding: 0.4rem 1rem; white-space: nowrap; + width: auto; } .dropdown-item:hover, .dropdown-item:focus { background-color: rgba(255, 255, 255, 0.1) !important; @@ -310,8 +318,12 @@ pre code { margin-top: 0; margin-left: 0; display: none; + --bs-dropdown-border-width: 0; + --bs-dropdown-border-radius: 0; + --bs-dropdown-box-shadow: none; border: none !important; border-radius: 0 !important; + box-shadow: none !important; } .dropdown-submenu:hover > .dropdown-menu { display: block; diff --git a/themes/default/assets/scss/theme.scss b/themes/default/assets/scss/theme.scss index 6a7004c..98c17a1 100644 --- a/themes/default/assets/scss/theme.scss +++ b/themes/default/assets/scss/theme.scss @@ -106,21 +106,29 @@ $header-bg-opacity: 1; } } -// Language dropdown styling +// Dropdown menu styling — override Bootstrap variables completely .dropdown-menu { + --bs-dropdown-min-width: 0; + --bs-dropdown-padding-x: 0; + --bs-dropdown-padding-y: 0; + --bs-dropdown-border-width: 0; + --bs-dropdown-border-radius: 0; + --bs-dropdown-box-shadow: none; background-color: var(--header-bg) !important; border: none !important; border-radius: 0 !important; padding: 0 !important; margin: 0 !important; min-width: 0 !important; + box-shadow: none !important; } .dropdown-item { color: var(--header-font) !important; border-radius: 0 !important; - padding: 0.5rem 1rem; + padding: 0.4rem 1rem; white-space: nowrap; + width: auto; &:hover, &:focus { background-color: rgba(255, 255, 255, 0.1) !important; @@ -313,8 +321,12 @@ $header-bg-opacity: 1; margin-top: 0; margin-left: 0; display: none; + --bs-dropdown-border-width: 0; + --bs-dropdown-border-radius: 0; + --bs-dropdown-box-shadow: none; border: none !important; border-radius: 0 !important; + box-shadow: none !important; } // Open submenu on hover (desktop)