refactor(docs-infra): scope nav-item styles to the `<aio-nav-item>` element (#40704)

This commit ensures that all styles for the sidenav nav-items (which are
defined in `_sidenav.scss`) only apply to elements inside an
`<aio-nav-item>` element. This will prevent the styles accidentally
taking effect on a different part of the app.

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

View File

@ -3,24 +3,6 @@
transition: none;
}
aio-nav-menu {
display: block;
margin: 0 auto;
max-width: 268px;
&:first-of-type {
margin-top: 16px;
}
&:last-of-type {
margin-bottom: 16px;
}
ul, a {
margin: 0;
}
}
mat-sidenav-container.sidenav-container {
background-color: $white;
min-height: 100%;
@ -72,7 +54,25 @@ mat-sidenav-container.sidenav-container {
}
}
.vertical-menu-item {
aio-nav-menu {
display: block;
margin: 0 auto;
max-width: 268px;
&:first-of-type {
margin-top: 16px;
}
&:last-of-type {
margin-bottom: 16px;
}
ul, a {
margin: 0;
}
aio-nav-item {
.vertical-menu-item {
box-sizing: border-box;
color: $darkgray;
cursor: pointer;
@ -109,16 +109,16 @@ mat-sidenav-container.sidenav-container {
height: 24px;
width: 24px;
}
}
}
button.vertical-menu-item {
button.vertical-menu-item {
border: none;
background-color: transparent;
margin: 0;
width: 100%;
}
}
.heading-children {
.heading-children {
&.expanded {
visibility: visible;
opacity: 1;
@ -142,9 +142,9 @@ button.vertical-menu-item {
.no-animations &.collapsed {
transition: none !important;
}
}
}
.level-1 {
.level-1 {
font-family: $main-font;
@include font-size(16);
@include line-height(28);
@ -152,34 +152,34 @@ button.vertical-menu-item {
padding-left: 20px;
margin: 0;
transition: background-color 0.2s;
}
}
.level-2 {
.level-2 {
font-family: $main-font;
@include font-size(14);
@include line-height(24);
font-weight: 400;
margin: 0;
padding-left: 36px;
}
}
.level-3 {
.level-3 {
font-family: $main-font;
@include font-size(14);
@include line-height(24);
margin: 0;
padding-left: 44px;
}
}
.level-4 {
.level-4 {
font-family: $main-font;
@include font-size(14);
@include line-height(24);
margin: 0;
padding-left: 52px;
}
}
.level-1, .level-2, .level-3 {
.level-1, .level-2, .level-3 {
&.collapsed > .mat-icon {
@include rotate(0deg);
}
@ -187,4 +187,6 @@ button.vertical-menu-item {
&.expanded > .mat-icon {
@include rotate(90deg);
}
}
}
}