Skip to content

Commit

Permalink
[DURACOM-195] fix spacing in collapsible menu
Browse files Browse the repository at this point in the history
  • Loading branch information
davide-negretti committed Feb 27, 2024
1 parent fdbe7a6 commit a88282d
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 26 deletions.
1 change: 1 addition & 0 deletions src/styles/_custom_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

}
}
}
2 changes: 1 addition & 1 deletion src/themes/dspace/app/navbar/navbar.component.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<ng-container *ngIf="(isMobile$ | async) && (isAuthenticated$ | async)">
<ds-user-menu [inExpandableNavbar]="true"></ds-user-menu>
</ng-container>
<div class="navbar-nav h-100 align-items-md-stretch gapx-3" role="menubar">
<div class="navbar-nav h-100 align-items-md-stretch gapx-3" role="menubar" id="main-site-navigation" [ngClass]="(isMobile$ | async) ? 'navbar-nav-mobile' : 'navbar-nav-desktop'">
<ng-container *ngFor="let section of (sections | async)">
<ng-container
*ngComponentOutlet="(sectionMap$ | async).get(section.id)?.component; injector: (sectionMap$ | async).get(section.id)?.injector;"></ng-container>
Expand Down

0 comments on commit a88282d

Please sign in to comment.