Skip to content

Improvement sticky navbar #28840

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
@message-global-caution-link__color-active: @link__active__color;
@message-global-caution__border-color: none;

@header__background-color: false;
@header-panel__background-color: @color-gray-middle4;
@header-panel__text-color: @color-white;
@header-icons-color: @color-gray46;
Expand Down Expand Up @@ -331,6 +330,7 @@
}
}
}

.page-header .panel.wrapper {
.switcher {
.options {
Expand Down Expand Up @@ -404,6 +404,10 @@
// _____________________________________________

.media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__m) {
.page-header {
.lib-sticky();
}

.customer-name,
.customer-welcome + .authorization-link {
display: none;
Expand Down Expand Up @@ -501,6 +505,10 @@
height: 100%; // Stretch screen area for sticky footer
}

.nav-sections {
.lib-sticky();
}

.navigation ul {
padding: 0 8px;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

// Colors nesting
@page__background-color: @color-white;
@header__background-color: @page__background-color;

//
// Icons
Expand Down
10 changes: 10 additions & 0 deletions lib/web/css/source/lib/_utilities.less
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@
@fontValue: @_value;
}

.lib-sticky(
@_z-index: @z-index-1 - 1,
@_top: 0
) {
position: -webkit-sticky;
position: sticky;
top: @_top;
z-index: @_z-index;
}

.lib-visibility-hidden() {
height: 0;
visibility: hidden;
Expand Down