refactor(docs-infra): merge style rules in `_sidenav.scss` (#40704)

This commit cleans up the styles in `_sidenav.scss` by merging
together blocks that target the same elements.

It also applies the equivalent changes in `_notification.scss` rules
that override sidenav styles.

PR Close #40704
This commit is contained in:
George Kalpakas 2021-02-05 12:48:56 +02:00 committed by Alex Rickabaugh
parent c8b30f4fd9
commit e043e52a4f
2 changed files with 52 additions and 54 deletions

View File

@ -21,7 +21,23 @@ aio-nav-menu {
}
}
mat-sidenav.mat-sidenav.sidenav {
mat-sidenav-container.sidenav-container {
background-color: $white;
min-height: 100%;
height: auto !important;
max-width: 100%;
margin: 0;
transform: none;
&.has-floating-toc {
max-width: 82%;
}
.sidenav-content {
height: auto;
}
mat-sidenav.sidenav {
position: fixed;
top: 64px;
bottom: 0;
@ -33,26 +49,27 @@ mat-sidenav.mat-sidenav.sidenav {
&.collapsed {
top: 56px;
}
}
mat-sidenav-container.sidenav-container {
min-height: 100%;
height: auto !important;
max-width: 100%;
margin: 0;
transform: none;
// Angular Version Selector
.doc-version {
padding: 8px;
border-top: 1px solid $lightgray;
&.has-floating-toc {
max-width: 82%;
select {
outline: none;
width: 100%;
background: rgba($lightgray, 0.5);
height: 32px;
border: 1px solid $lightgray;
color: $darkgray;
option {
font-family: $main-font;
@include font-size(14);
}
}
}
}
}
mat-sidenav-container.sidenav-container.mat-drawer-container.mat-sidenav-container {
background-color: $white;
}
mat-sidenav-container div.mat-sidenav-content {
height: auto;
}
.vertical-menu-item {
@ -120,12 +137,10 @@ button.vertical-menu-item {
transition: visibility 275ms, opacity 275ms, max-height 280ms;
transition-timing-function: ease-out;
}
}
.no-animations {
.heading-children.expanded,
.heading-children.collapsed {
transition: none! important;
.no-animations &.expanded,
.no-animations &.collapsed {
transition: none !important;
}
}
@ -173,23 +188,3 @@ button.vertical-menu-item {
@include rotate(90deg);
}
}
// Angular Version Selector
mat-sidenav .doc-version {
padding: 8px;
border-top: 1px solid $lightgray;
select {
outline: none;
width: 100%;
background: rgba($lightgray, 0.5);
height: 32px;
border: 1px solid $lightgray;
color: $darkgray;
option {
font-family: $main-font;
@include font-size(14);
}
}
}

View File

@ -69,17 +69,19 @@ aio-notification {
// Here are all the hacks to make the content and sidebars the right height
// when the notification is visible
.aio-notification-show {
mat-sidenav-container.sidenav-container {
.sidenav-content {
padding-top: 80px + $notificationHeight;
}
mat-sidenav.mat-sidenav.sidenav {
mat-sidenav.sidenav {
top: 64px + $notificationHeight;
@media (max-width: 600px) {
top: 56px + $notificationHeight;
}
}
}
.toc-container {
top: 76px + $notificationHeight;
@ -90,7 +92,7 @@ aio-notification {
}
&.page-home, &.page-resources, &.page-events, &.page-features, &.page-presskit, &.page-contribute {
main {
.sidenav-content {
padding-top: $notificationHeight;
}
}
@ -104,7 +106,8 @@ aio-notification {
.sidenav-content {
transition: padding-top 250ms ease;
}
mat-sidenav.mat-sidenav.sidenav, .toc-container {
mat-sidenav.sidenav, .toc-container {
transition: top 250ms ease;
}
}