Commit 3b1393c4 authored by David O'Regan's avatar David O'Regan

Merge branch '322680-at-root' into 'master'

Remove excessive specificity in refactoring of left-hand panel with the flag OFF

See merge request gitlab-org/gitlab!62556
parents 696f4c28 71e55586
.page-with-contextual-sidebar {
transition: padding-left $sidebar-transition-duration;
@include media-breakpoint-up(md) {
padding-left: $contextual-sidebar-collapsed-width;
}
@include media-breakpoint-up(xl) {
padding-left: $contextual-sidebar-width;
}
.issues-bulk-update.right-sidebar.right-sidebar-expanded .issuable-sidebar-header {
padding: 10px 0 15px;
}
}
.page-with-icon-sidebar {
@include media-breakpoint-up(md) {
padding-left: $contextual-sidebar-collapsed-width;
}
}
.settings-avatar {
background-color: $white;
svg {
fill: $gl-text-color-secondary;
margin: auto;
}
}
@mixin collapse-contextual-sidebar-content { @mixin collapse-contextual-sidebar-content {
@include context-header-collapsed; @include context-header-collapsed;
...@@ -61,323 +30,357 @@ ...@@ -61,323 +30,357 @@
} }
} }
.nav-sidebar { @mixin collapse-contextual-sidebar {
transition: width $sidebar-transition-duration, left $sidebar-transition-duration; width: $contextual-sidebar-collapsed-width;
position: fixed;
z-index: 600; .nav-sidebar-inner-scroll {
width: $contextual-sidebar-width; overflow-x: hidden;
top: $header-height;
bottom: 0;
left: 0;
background-color: $gray-light;
box-shadow: inset -1px 0 0 $border-color;
transform: translate3d(0, 0, 0);
&:not(.sidebar-collapsed-desktop) {
@media (min-width: map-get($grid-breakpoints, sm)) and (max-width: map-get($grid-breakpoints, sm)) {
box-shadow: inset -1px 0 0 $border-color, 2px 1px 3px $dropdown-shadow-color;
}
} }
@mixin collapse-contextual-sidebar { .badge.badge-pill:not(.fly-out-badge),
width: $contextual-sidebar-collapsed-width; .nav-item-name {
@include gl-sr-only;
}
.nav-sidebar-inner-scroll { .sidebar-top-level-items > li > a {
overflow-x: hidden; min-height: 45px;
} }
.badge.badge-pill:not(.fly-out-badge), .fly-out-top-item {
.nav-item-name { display: block;
@include gl-sr-only; }
}
.avatar-container {
margin: 0 auto;
}
}
@at-root {
.page-with-contextual-sidebar {
transition: padding-left $sidebar-transition-duration;
.sidebar-top-level-items > li > a { @include media-breakpoint-up(md) {
min-height: 45px; padding-left: $contextual-sidebar-collapsed-width;
} }
.fly-out-top-item { @include media-breakpoint-up(xl) {
display: block; padding-left: $contextual-sidebar-width;
} }
.avatar-container { .issues-bulk-update.right-sidebar.right-sidebar-expanded .issuable-sidebar-header {
margin: 0 auto; padding: 10px 0 15px;
} }
} }
&.sidebar-collapsed-desktop { .page-with-icon-sidebar {
@include collapse-contextual-sidebar; @include media-breakpoint-up(md) {
padding-left: $contextual-sidebar-collapsed-width;
}
} }
&.sidebar-expanded-mobile { .settings-avatar {
left: 0; background-color: $white;
}
a { svg {
text-decoration: none; fill: $gl-text-color-secondary;
margin: auto;
}
} }
ul { .nav-sidebar {
padding-left: 0; transition: width $sidebar-transition-duration, left $sidebar-transition-duration;
list-style: none; position: fixed;
} z-index: 600;
width: $contextual-sidebar-width;
top: $header-height;
bottom: 0;
left: 0;
background-color: $gray-light;
box-shadow: inset -1px 0 0 $border-color;
transform: translate3d(0, 0, 0);
li { &:not(.sidebar-collapsed-desktop) {
white-space: nowrap; @media (min-width: map-get($grid-breakpoints, sm)) and (max-width: map-get($grid-breakpoints, sm)) {
box-shadow: inset -1px 0 0 $border-color, 2px 1px 3px $dropdown-shadow-color;
}
}
a { &.sidebar-collapsed-desktop {
transition: padding $sidebar-transition-duration; @include collapse-contextual-sidebar;
display: flex;
align-items: center;
padding: 12px $gl-padding;
color: $gl-text-color-secondary;
} }
.nav-item-name { &.sidebar-expanded-mobile {
flex: 1; left: 0;
} }
&.active { a {
> a { text-decoration: none;
font-weight: $gl-font-weight-bold;
}
} }
}
@include media-breakpoint-down(sm) { ul {
left: (-$contextual-sidebar-width); padding-left: 0;
} list-style: none;
}
.nav-icon-container { li {
display: flex; white-space: nowrap;
margin-right: 8px;
}
.fly-out-top-item { a {
display: none; transition: padding $sidebar-transition-duration;
} display: flex;
align-items: center;
padding: 12px $gl-padding;
color: $gl-text-color-secondary;
}
svg { .nav-item-name {
height: 16px; flex: 1;
width: 16px; }
}
@media (min-width: map-get($grid-breakpoints, md)) and (max-width: map-get($grid-breakpoints, xl) - 1px) { &.active {
&:not(.sidebar-expanded-mobile) { > a {
@include collapse-contextual-sidebar; font-weight: $gl-font-weight-bold;
@include collapse-contextual-sidebar-content; }
}
} }
}
}
.nav-sidebar-inner-scroll { @include media-breakpoint-down(sm) {
height: 100%; left: (-$contextual-sidebar-width);
width: 100%; }
overflow: auto;
}
.sidebar-sub-level-items { .nav-icon-container {
display: none; display: flex;
padding-bottom: 8px; margin-right: 8px;
}
> li { .fly-out-top-item {
a { display: none;
padding: 8px 16px 8px 40px; }
&:hover, svg {
&:focus { height: 16px;
background: $link-active-background; width: 16px;
color: $gl-text-color; }
@media (min-width: map-get($grid-breakpoints, md)) and (max-width: map-get($grid-breakpoints, xl) - 1px) {
&:not(.sidebar-expanded-mobile) {
@include collapse-contextual-sidebar;
@include collapse-contextual-sidebar-content;
} }
} }
}
.nav-sidebar-inner-scroll {
height: 100%;
width: 100%;
overflow: auto;
}
.sidebar-sub-level-items {
display: none;
padding-bottom: 8px;
&.active { > li {
a { a {
&, padding: 8px 16px 8px 40px;
&:hover, &:hover,
&:focus { &:focus {
background: $link-active-background; background: $link-active-background;
color: $gl-text-color;
}
}
&.active {
a {
&,
&:hover,
&:focus {
background: $link-active-background;
}
} }
} }
} }
} }
}
.sidebar-top-level-items { .sidebar-top-level-items {
margin-bottom: 60px; margin-bottom: 60px;
> li { > li {
> a { > a {
@include media-breakpoint-up(sm) { @include media-breakpoint-up(sm) {
margin-right: 1px; margin-right: 1px;
} }
&:hover { &:hover {
color: $gl-text-color; color: $gl-text-color;
}
} }
}
&.is-showing-fly-out { &.is-showing-fly-out {
> a { > a {
margin-right: 1px; margin-right: 1px;
} }
.sidebar-sub-level-items { .sidebar-sub-level-items {
@include media-breakpoint-up(sm) { @include media-breakpoint-up(sm) {
position: fixed; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
min-width: 150px; min-width: 150px;
margin-top: -1px; margin-top: -1px;
padding: 4px 1px; padding: 4px 1px;
background-color: $white; background-color: $white;
box-shadow: 2px 1px 3px $dropdown-shadow-color; box-shadow: 2px 1px 3px $dropdown-shadow-color;
border: 1px solid $gray-darker; border: 1px solid $gray-darker;
border-left: 0; border-left: 0;
border-radius: 0 3px 3px 0; border-radius: 0 3px 3px 0;
&::before { &::before {
content: ''; content: '';
position: absolute; position: absolute;
top: -30px; top: -30px;
bottom: -30px; bottom: -30px;
left: -10px; left: -10px;
right: -30px; right: -30px;
z-index: -1; z-index: -1;
} }
&.is-above { &.is-above {
margin-top: 1px; margin-top: 1px;
} }
.divider { .divider {
height: 1px; height: 1px;
margin: 4px -1px; margin: 4px -1px;
padding: 0; padding: 0;
background-color: $dropdown-divider-bg; background-color: $dropdown-divider-bg;
} }
> .active { > .active {
box-shadow: none; box-shadow: none;
> a { > a {
background-color: transparent; background-color: transparent;
}
} }
}
a { a {
padding: 8px 16px; padding: 8px 16px;
color: $gl-text-color; color: $gl-text-color;
&:hover, &:hover,
&:focus { &:focus {
background-color: $gray-darker; background-color: $gray-darker;
}
} }
} }
} }
} }
}
.badge.badge-pill { .badge.badge-pill {
background-color: $inactive-badge-background; background-color: $inactive-badge-background;
color: $gl-text-color-secondary; color: $gl-text-color-secondary;
} }
&.active { &.active {
background: $link-active-background; background: $link-active-background;
> a { > a {
margin-left: 4px; margin-left: 4px;
// Subtract width of left border on active element // Subtract width of left border on active element
padding-left: $gl-padding-12; padding-left: $gl-padding-12;
} }
.badge.badge-pill { .badge.badge-pill {
font-weight: $gl-font-weight-bold; font-weight: $gl-font-weight-bold;
} }
.sidebar-sub-level-items:not(.is-fly-out-only) { .sidebar-sub-level-items:not(.is-fly-out-only) {
display: block; display: block;
}
} }
}
&.active > a:hover, &.active > a:hover,
&.is-over > a { &.is-over > a {
background-color: $link-hover-background; background-color: $link-hover-background;
}
} }
} }
}
// Collapsed nav // Collapsed nav
.toggle-sidebar-button, .toggle-sidebar-button,
.close-nav-button { .close-nav-button {
@include side-panel-toggle; @include side-panel-toggle;
} }
.toggle-sidebar-button, .toggle-sidebar-button,
.close-nav-button { .close-nav-button {
position: fixed; position: fixed;
bottom: 0; bottom: 0;
width: $contextual-sidebar-width - 1px; width: $contextual-sidebar-width - 1px;
border-top: 1px solid $border-color; border-top: 1px solid $border-color;
svg { svg {
margin-right: 8px; margin-right: 8px;
}
.icon-chevron-double-lg-right {
display: none;
}
} }
.icon-chevron-double-lg-right { .collapse-text {
display: none; white-space: nowrap;
overflow: hidden;
} }
}
.collapse-text { .sidebar-collapsed-desktop {
white-space: nowrap; @include collapse-contextual-sidebar-content;
overflow: hidden; }
}
.sidebar-collapsed-desktop { .fly-out-top-item {
@include collapse-contextual-sidebar-content; > a {
} display: flex;
}
.fly-out-top-item { .fly-out-badge {
> a { margin-left: 8px;
display: flex; }
} }
.fly-out-badge { .fly-out-top-item-name {
margin-left: 8px; flex: 1;
} }
}
.fly-out-top-item-name { // Mobile nav
flex: 1;
}
// Mobile nav
.close-nav-button {
display: none;
}
@include media-breakpoint-down(sm) {
.close-nav-button { .close-nav-button {
display: flex;
}
.toggle-sidebar-button {
display: none; display: none;
} }
.mobile-overlay { @include media-breakpoint-down(sm) {
display: none; .close-nav-button {
display: flex;
}
&.mobile-nav-open { .toggle-sidebar-button {
display: block; display: none;
position: fixed; }
background-color: $black-transparent;
height: 100%; .mobile-overlay {
width: 100%; display: none;
z-index: $zindex-dropdown-menu;
&.mobile-nav-open {
display: block;
position: fixed;
background-color: $black-transparent;
height: 100%;
width: 100%;
z-index: $zindex-dropdown-menu;
}
} }
} }
} }
.page-with-contextual-sidebar {
transition: padding-left $sidebar-transition-duration;
@include media-breakpoint-up(md) {
padding-left: $contextual-sidebar-collapsed-width;
}
@include media-breakpoint-up(xl) {
padding-left: $contextual-sidebar-width;
}
.issues-bulk-update.right-sidebar.right-sidebar-expanded .issuable-sidebar-header {
padding: 10px 0 15px;
}
}
.page-with-icon-sidebar {
@include media-breakpoint-up(md) {
padding-left: $contextual-sidebar-collapsed-width;
}
}
.settings-avatar {
background-color: $white;
svg {
fill: $gl-text-color-secondary;
margin: auto;
}
}
@mixin collapse-contextual-sidebar-content { @mixin collapse-contextual-sidebar-content {
@include context-header-collapsed; @include context-header-collapsed;
...@@ -61,6 +30,62 @@ ...@@ -61,6 +30,62 @@
} }
} }
@mixin collapse-contextual-sidebar {
width: $contextual-sidebar-collapsed-width;
.nav-sidebar-inner-scroll {
overflow-x: hidden;
}
.badge.badge-pill:not(.fly-out-badge),
.nav-item-name {
@include gl-sr-only;
}
.sidebar-top-level-items > li > a {
min-height: 45px;
}
.fly-out-top-item {
display: block;
}
.avatar-container {
margin: 0 auto;
}
}
.page-with-contextual-sidebar {
transition: padding-left $sidebar-transition-duration;
@include media-breakpoint-up(md) {
padding-left: $contextual-sidebar-collapsed-width;
}
@include media-breakpoint-up(xl) {
padding-left: $contextual-sidebar-width;
}
.issues-bulk-update.right-sidebar.right-sidebar-expanded .issuable-sidebar-header {
padding: 10px 0 15px;
}
}
.page-with-icon-sidebar {
@include media-breakpoint-up(md) {
padding-left: $contextual-sidebar-collapsed-width;
}
}
.settings-avatar {
background-color: $white;
svg {
fill: $gl-text-color-secondary;
margin: auto;
}
}
.nav-sidebar { .nav-sidebar {
transition: width $sidebar-transition-duration, left $sidebar-transition-duration; transition: width $sidebar-transition-duration, left $sidebar-transition-duration;
position: fixed; position: fixed;
...@@ -79,31 +104,6 @@ ...@@ -79,31 +104,6 @@
} }
} }
@mixin collapse-contextual-sidebar {
width: $contextual-sidebar-collapsed-width;
.nav-sidebar-inner-scroll {
overflow-x: hidden;
}
.badge.badge-pill:not(.fly-out-badge),
.nav-item-name {
@include gl-sr-only;
}
.sidebar-top-level-items > li > a {
min-height: 45px;
}
.fly-out-top-item {
display: block;
}
.avatar-container {
margin: 0 auto;
}
}
&.sidebar-collapsed-desktop { &.sidebar-collapsed-desktop {
@include collapse-contextual-sidebar; @include collapse-contextual-sidebar;
} }
...@@ -381,3 +381,4 @@ ...@@ -381,3 +381,4 @@
} }
} }
} }
...@@ -137,5 +137,5 @@ ...@@ -137,5 +137,5 @@
} }
.with-performance-bar .nav-sidebar { .with-performance-bar .nav-sidebar {
top: $header-height + $performance-bar-height !important; top: $header-height + $performance-bar-height;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment