Skip to content

Commit

Permalink
src/themes/cgspace: import scss from dspace theme
Browse files Browse the repository at this point in the history
Instead of copying the entire SCSS and having to keep it in sync
with upstream changes, just import the styles and override what
we need.
  • Loading branch information
alanorth committed Oct 23, 2023
1 parent 5d861a2 commit b399e67
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 78 deletions.
26 changes: 2 additions & 24 deletions src/themes/cgspace/app/header/header.component.scss
Original file line number Diff line number Diff line change
@@ -1,28 +1,6 @@
@media screen and (min-width: map-get($grid-breakpoints, md)) {
nav.navbar {
display: none;
}
}
@import '../../../dspace/app/header/header.component.scss';

/* always set header background, not only on medium size screens! */
// The dspace theme only sets the header background on medium screens and up
.header {
background-color: var(--ds-header-bg);
}

.navbar-brand img {
@media screen and (max-width: map-get($grid-breakpoints, md)) {
height: var(--ds-header-logo-height-xs);
}
}
.navbar-toggler .navbar-toggler-icon {
background-image: none !important;
line-height: 1.5;
}

.navbar-toggler {
color: var(--ds-header-icon-color);

&:hover, &:focus {
color: var(--ds-header-icon-color-hover);
}
}
59 changes: 5 additions & 54 deletions src/themes/cgspace/app/navbar/navbar.component.scss
Original file line number Diff line number Diff line change
@@ -1,61 +1,12 @@
nav.navbar {
// Ignore this style from the dspace theme because it creates a white gap
//border-top: 1px var(--ds-header-navbar-border-top-color) solid;
border-bottom: 5px var(--ds-header-navbar-border-bottom-color) solid;
align-items: baseline;
color: var(--ds-header-icon-color);
}

/** Mobile menu styling **/
@media screen and (max-width: map-get($grid-breakpoints, md)-0.02) {
.navbar {
width: 100vw;
background-color: var(--bs-white);
position: absolute;
overflow: hidden;
height: 0;
&.open {
height: 100vh; //doesn't matter because wrapper is sticky
}
}
}

@media screen and (min-width: map-get($grid-breakpoints, md)) {
.reset-padding-md {
margin-left: calc(var(--bs-spacer) / -2);
margin-right: calc(var(--bs-spacer) / -2);
}
}
@import '../../../dspace/app/navbar/navbar.component.scss';

/* TODO remove when https://github.com/twbs/bootstrap/issues/24726 is fixed */
.navbar-expand-md.navbar-container {
@media screen and (max-width: map-get($grid-breakpoints, md)-0.02) {
> .navbar-inner-container {
padding: 0 var(--bs-spacer);
a.navbar-brand {
display: none;
}
.navbar-collapsed {
display: none;
}
}
padding: 0;
}
height: 80px;
}

a.navbar-brand img {
max-height: var(--ds-header-logo-height);
nav.navbar {
// Override this style from the dspace theme because it creates a white gap
// on mobile.
border-top: none;
}

.navbar-nav {
::ng-deep a.nav-link {
color: var(--ds-navbar-link-color);
}
::ng-deep a.nav-link:hover {
color: var(--ds-navbar-link-color-hover);
}

::ng-deep ul a.nav-link {
color: var(--ds-home-news-link-color);
}
Expand Down

0 comments on commit b399e67

Please sign in to comment.