Skip to content

Commit

Permalink
Update z-index of the sticky panel under the header (#1079)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhx828 authored Jan 26, 2024
1 parent 2446b47 commit e3691d9
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 14 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 20 additions & 10 deletions src/main/webapp/app/layout.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
@mixin sticky-footer($footer-height) {
$view-wrapper-default-p-y: 2rem !default;

@mixin sticky-panel-under-header($header-height) {
.sticky-panel-relevant-to-header {
top: $header-height + 3;
z-index: $zindex-sticky - 10;
}
}

@mixin sticky-footer($view-wrapper-default-p-y, $footer-height) {
.view-wrapper {
margin: 0 auto (-$footer-height);
padding: $view-wrapper-default-p-y 0
Expand Down Expand Up @@ -29,7 +38,9 @@

@include media-breakpoint-up(xs) {
$footer-height: 22rem;
@include sticky-footer($footer-height);
$header-height: 4.5rem;
@include sticky-footer(1rem, $footer-height);
@include sticky-panel-under-header($header-height);
.navbar-brand {
margin-right: 1rem;
margin-bottom: 0.3rem;
Expand All @@ -56,22 +67,16 @@
padding-left: 1rem;
padding-right: 1rem;
}
.sticky-panel-relevant-to-header {
top: 0;
}
}

@include media-breakpoint-up(sm) {
$footer-height: 17rem;
.sticky-panel-relevant-to-header {
top: 106px;
}
@include sticky-footer($footer-height);
@include sticky-footer($view-wrapper-default-p-y, $footer-height);
}

@include media-breakpoint-up(lg) {
$footer-height: 12rem;
@include sticky-footer($footer-height);
@include sticky-footer($view-wrapper-default-p-y, $footer-height);
.navbar {
// add padding to align with nav item border bottom
padding-top: $navbar-padding-top;
Expand All @@ -89,6 +94,11 @@
}
}

@include media-breakpoint-up(md) {
$header-height: 4.5rem;
@include sticky-panel-under-header($header-height);
}

@include media-breakpoint-up(xl) {
.navbar-nav > .nav-item {
line-height: 2.5rem;
Expand Down
3 changes: 2 additions & 1 deletion src/main/webapp/app/pages/aboutGroup/AboutPageNavTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ export class AboutPageNavTab extends React.Component<AboutPageNavTabProps> {
className={classnames(
'flex-column',
'sticky-top',
'sticky-panel-relevant-to-header'
'sticky-panel-relevant-to-header',
'mb-3'
)}
>
<Nav.Item>
Expand Down
3 changes: 2 additions & 1 deletion src/main/webapp/app/pages/newsPage/NewsPageNavTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ export class NewsPageNavTab extends React.Component<NewsPageNavTabProps> {
className={classnames(
'flex-column',
'sticky-top',
'sticky-panel-relevant-to-header'
'sticky-panel-relevant-to-header',
'mb-3'
)}
>
<Nav.Item>
Expand Down
2 changes: 0 additions & 2 deletions src/main/webapp/app/variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,4 @@ $container-max-widths: (
xl: 1500px,
) !default;

$view-wrapper-default-p-y: 2rem;

$bigger-default-font-size: 1.2rem;

0 comments on commit e3691d9

Please sign in to comment.