From a88282d70b8677712d5515ca697c46276840e774 Mon Sep 17 00:00:00 2001 From: Davide Negretti Date: Tue, 27 Feb 2024 14:05:48 +0100 Subject: [PATCH] [DURACOM-195] fix spacing in collapsible menu --- src/styles/_custom_variables.scss | 1 + .../header-navbar-wrapper.component.scss | 57 +++++++++++-------- .../dspace/app/navbar/navbar.component.html | 2 +- 3 files changed, 34 insertions(+), 26 deletions(-) diff --git a/src/styles/_custom_variables.scss b/src/styles/_custom_variables.scss index 98aa268022b..ce776bb1ac7 100644 --- a/src/styles/_custom_variables.scss +++ b/src/styles/_custom_variables.scss @@ -39,6 +39,7 @@ --ds-expandable-navbar-link-color: #{$body-color}; --ds-expandable-navbar-link-color-hover: #{$body-color}; --ds-expandable-navbar-link-background-hover: #{$ds-navbar-link-color-hover}; + --ds-expandable-navbar-item-vertical-padding: 0.25rem; --ds-user-menu-item-vertical-padding: 0.25rem; --ds-user-menu-dropdown-padding: 1rem; diff --git a/src/themes/dspace/app/header-nav-wrapper/header-navbar-wrapper.component.scss b/src/themes/dspace/app/header-nav-wrapper/header-navbar-wrapper.component.scss index 77e2d4ad519..444d3a97220 100644 --- a/src/themes/dspace/app/header-nav-wrapper/header-navbar-wrapper.component.scss +++ b/src/themes/dspace/app/header-nav-wrapper/header-navbar-wrapper.component.scss @@ -32,43 +32,50 @@ text-decoration: none; } - nav#desktop-navbar ::ng-deep { + nav#desktop-navbar { // in header component + #main-site-navigation { + /* Desktop menu */ - /* Desktop menu */ - - .ds-menu-item-wrapper, .ds-menu-item, .ds-menu-toggler-wrapper { - // fill navbar height (required by dropdown menus) and center content - display: flex; - align-items: center; - height: 100%; - } - .ds-menu-item { - // define here the style for top-level navbar menu items - padding: var(--ds-navbar-item-vertical-padding) var(--ds-navbar-item-horizontal-padding); - } - .ds-menu-item, .ds-menu-toggler-wrapper { - color: var(--ds-navbar-link-color) !important; - &:hover, &:focus { - color: var(--ds-navbar-link-color-hover) !important; + .ds-menu-item-wrapper, .ds-menu-item, .ds-menu-toggler-wrapper { + // fill navbar height (required by dropdown menus) and center content + display: flex; + align-items: center; + height: 100%; + } + .ds-menu-item { + // define here the style for top-level navbar menu items + padding: var(--ds-navbar-item-vertical-padding) var(--ds-navbar-item-horizontal-padding); + } + .ds-menu-item, .ds-menu-toggler-wrapper { + color: var(--ds-navbar-link-color) !important; + &:hover, &:focus { + color: var(--ds-navbar-link-color-hover) !important; + } } - } - /* desktop submenu */ + /* desktop submenu */ - .dropdown-menu { - .ds-menu-item { - // define here the style for second-level navbar menu items - padding: var(--ds-navbar-dropdown-item-vertical-padding) var(--ds-navbar-dropdown-item-horizontal-padding); + .dropdown-menu { + .ds-menu-item { + // define here the style for second-level navbar menu items + padding: var(--ds-navbar-dropdown-item-vertical-padding) var(--ds-navbar-dropdown-item-horizontal-padding); + } } - } + } } - nav#collapsible-mobile-navbar { + nav#collapsible-mobile-navbar { // in header-navbar-wrapper component border-top: var(--ds-expandable-navbar-border-top-style); padding-top: var(--ds-expandable-navbar-padding-top); + #main-site-navigation { + .ds-menu-item { + padding: var(--ds-expandable-navbar-item-vertical-padding) 0; + } + } + } } } diff --git a/src/themes/dspace/app/navbar/navbar.component.html b/src/themes/dspace/app/navbar/navbar.component.html index 518d3bbe302..d828206e7ae 100644 --- a/src/themes/dspace/app/navbar/navbar.component.html +++ b/src/themes/dspace/app/navbar/navbar.component.html @@ -1,7 +1,7 @@ -