refactor(docs-infra): scope top-menu styles to the `.app-toolbar` element (#40704)

This commit ensures that all styles for the app top-menu (which are
defined in `_top-menu.scss`) only apply to elements inside an
`.app-toolbar` 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:57 +02:00 committed by Alex Rickabaugh
parent e3f5f9331b
commit b258b2901c
1 changed files with 177 additions and 177 deletions

View File

@ -62,6 +62,183 @@ mat-toolbar.app-toolbar {
color: $white;
}
// HAMBURGER BUTTON
.hamburger {
height: 100%;
margin: $hamburgerShownMargin;
padding: 0;
@media (min-width: $showTopMenuWidth) {
// Hamburger hidden by default on large screens.
// (Will be shown per doc.)
margin: $hamburgerHiddenMargin;
}
@media (max-width: 480px) {
min-width: 15%;
}
&:not(.starting) {
transition-duration: 0.4s;
transition-property: color, margin;
transition-timing-function: cubic-bezier(0.25, 0.8, 0.25, 1);
}
&:hover {
color: $offwhite;
}
& .mat-icon {
color: $white;
position: inherit;
}
}
// HOME NAV-LINK
.nav-link.home {
cursor: pointer;
margin: 0 16px 0 0;
padding: 8px 0;
&:focus {
// `outline-offset` is not applied on Chrome on Windows, if `outline-style` is `auto.
outline: 1px solid $focus-outline-ondark;
outline-offset: 4px;
}
@media screen and (max-width: $hideTopMenuWidth) {
padding: 4px 0;
}
@media screen and (max-width: 480px) {
margin-right: 8px;
}
img {
position: relative;
margin-top: -21px;
top: 12px;
height: 40px;
@media (max-width: $hideTopMenuWidth) {
&:hover {
transform: scale(1.1);
}
}
}
}
// TOP MENU
aio-top-menu {
display: flex;
flex-direction: row;
align-items: center;
width: 80%;
ul {
display: flex;
flex-direction: row;
align-items: center;
list-style-position: inside;
padding: 0px;
margin: 0px;
li {
padding-bottom: 2px;
list-style-type: none;
cursor: pointer;
&:focus {
outline: none;
}
a.nav-link {
margin: 0 4px;
padding: 0px;
cursor: pointer;
.nav-link-inner {
border-radius: 4px;
padding: 8px 16px;
&:hover {
background: rgba($white, 0.15);
}
}
&:focus {
outline: none;
.nav-link-inner {
background: rgba($white, 0.15);
border-radius: 1px;
box-shadow: 0 0 1px 2px $focus-outline-ondark;
}
}
&:active {
.nav-link-inner {
background: rgba($white, 0.15);
}
}
}
&.selected {
a.nav-link {
.nav-link-inner {
background: rgba($white, 0.15);
}
}
}
}
}
}
// SEARCH BOX
aio-search-box.search-container {
display: flex;
justify-content: flex-end;
align-items: center;
width: 100%;
min-width: 150px;
height: 100%;
margin-right: 16px;
input {
color: $darkgray;
border: none;
border-radius: 100px;
background-color: $white;
padding: 5px 16px;
margin-left: 8px;
width: 180px;
max-width: 240px;
height: 50%;
-webkit-appearance: none;
&:focus {
outline: none;
}
@include placeholder {
@include font-size(14);
color: $mediumgray;
}
@include bp(big) {
transition: width 0.4s ease-in-out;
&:focus {
width: 80%;
}
}
@media (max-width: 480px) {
width: 150px;
}
}
}
// EXTERNAL LINK ICONS
.toolbar-external-icons-container {
display: flex;
@ -96,180 +273,3 @@ mat-toolbar.app-toolbar {
}
}
}
// HAMBURGER BUTTON
.hamburger {
height: 100%;
margin: $hamburgerShownMargin;
padding: 0;
@media (min-width: $showTopMenuWidth) {
// Hamburger hidden by default on large screens.
// (Will be shown per doc.)
margin: $hamburgerHiddenMargin;
}
@media (max-width: 480px) {
min-width: 15%;
}
&:not(.starting) {
transition-duration: 0.4s;
transition-property: color, margin;
transition-timing-function: cubic-bezier(0.25, 0.8, 0.25, 1);
}
&:hover {
color: $offwhite;
}
& .mat-icon {
color: $white;
position: inherit;
}
}
// HOME NAV-LINK
.nav-link.home {
cursor: pointer;
margin: 0 16px 0 0;
padding: 8px 0;
&:focus {
// `outline-offset` is not applied on Chrome on Windows, if `outline-style` is `auto.
outline: 1px solid $focus-outline-ondark;
outline-offset: 4px;
}
@media screen and (max-width: $hideTopMenuWidth) {
padding: 4px 0;
}
@media screen and (max-width: 480px) {
margin-right: 8px;
}
img {
position: relative;
margin-top: -21px;
top: 12px;
height: 40px;
@media (max-width: $hideTopMenuWidth) {
&:hover {
transform: scale(1.1);
}
}
}
}
// TOP MENU
aio-top-menu {
display: flex;
flex-direction: row;
align-items: center;
width: 80%;
ul {
display: flex;
flex-direction: row;
align-items: center;
list-style-position: inside;
padding: 0px;
margin: 0px;
li {
padding-bottom: 2px;
list-style-type: none;
cursor: pointer;
&:focus {
outline: none;
}
a.nav-link {
margin: 0 4px;
padding: 0px;
cursor: pointer;
.nav-link-inner {
border-radius: 4px;
padding: 8px 16px;
&:hover {
background: rgba($white, 0.15);
}
}
&:focus {
outline: none;
.nav-link-inner {
background: rgba($white, 0.15);
border-radius: 1px;
box-shadow: 0 0 1px 2px $focus-outline-ondark;
}
}
&:active {
.nav-link-inner {
background: rgba($white, 0.15);
}
}
}
&.selected {
a.nav-link {
.nav-link-inner {
background: rgba($white, 0.15);
}
}
}
}
}
}
// SEARCH BOX
aio-search-box.search-container {
display: flex;
justify-content: flex-end;
align-items: center;
width: 100%;
min-width: 150px;
height: 100%;
margin-right: 16px;
input {
color: $darkgray;
border: none;
border-radius: 100px;
background-color: $white;
padding: 5px 16px;
margin-left: 8px;
width: 180px;
max-width: 240px;
height: 50%;
-webkit-appearance: none;
&:focus {
outline: none;
}
@include placeholder {
@include font-size(14);
color: $mediumgray;
}
@include bp(big) {
transition: width 0.4s ease-in-out;
&:focus {
width: 80%;
}
}
@media (max-width: 480px) {
width: 150px;
}
}
}