diff --git a/aio/src/styles/0-base/_typography-theme.scss b/aio/src/styles/0-base/_typography-theme.scss new file mode 100644 index 0000000000..e512fa7435 --- /dev/null +++ b/aio/src/styles/0-base/_typography-theme.scss @@ -0,0 +1,52 @@ +@use '../constants' as *; +@use '~@angular/material/theming' as *; + +@mixin typography-theme($theme) { + $primary: map-get($theme, primary); + $background: map-get($theme, background); + $foreground: map-get($theme, foreground); + $is-dark-theme: map-get($theme, is-dark); + + body { + color: if($is-dark-theme, $offwhite, $darkgray); + } + + h1, + h2, + h3, + h4, + h5, + h6 { + color: if($is-dark-theme, $offwhite, $darkgray); + } + + h6 { + color: if($is-dark-theme, $offwhite, $mediumgray); + } + + p, + ol, + ul, + ol, + li, + input, + a { + color: if($is-dark-theme, $white, $darkgray); + } + + .app-toolbar a { + color: if($is-dark-theme, $darkgray, $white); + } + + code { + color: if($is-dark-theme, $white, $darkgray); + } + + .sidenav-content a { + color: if($is-dark-theme, lighten($blue, 20), $blue); + } + + .error-text { + color: $brightred; + } +} diff --git a/aio/src/styles/0-base/_typography.scss b/aio/src/styles/0-base/_typography.scss index 84143afd71..19b32ab776 100755 --- a/aio/src/styles/0-base/_typography.scss +++ b/aio/src/styles/0-base/_typography.scss @@ -8,14 +8,12 @@ html { body { font-family: $main-font; margin: 0; - color: $darkgray; @include font-size(16); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } h1, h2, h3, h4, h5, h6 { - color: $deepgray; margin-bottom: 0; font-weight: 500; } @@ -64,7 +62,6 @@ h5 { h6 { @include font-size(16); - color: $mediumgray; margin-top: 2rem; clear: both; } @@ -97,7 +94,6 @@ a { @include line-height(32); font-family: inherit; font-weight: 400; - color: $darkgray; & > em { @include letter-spacing(0.3); @@ -143,7 +139,6 @@ a { .app-toolbar a { @include font-size(16); font-weight: 400; - color: $white; font-family: $main-font; text-transform: uppercase; } @@ -190,12 +185,9 @@ th { code { font-family: $code-font; font-size: 90%; - color: $darkgray; } .sidenav-content a { - color: $blue; - &:hover { text-decoration: underline; } @@ -227,8 +219,4 @@ code { } } } -} - -.error-text { - color: $brightred; -} +} \ No newline at end of file diff --git a/aio/src/styles/1-layouts/_index.scss b/aio/src/styles/1-layouts/_index.scss index 8f57fd4eb3..0ff377dcff 100644 --- a/aio/src/styles/1-layouts/_index.scss +++ b/aio/src/styles/1-layouts/_index.scss @@ -2,11 +2,11 @@ LAYOUT STYLES ============================== */ -@forward 'content-layout/content-layout'; -@forward 'doc-viewer/doc-viewer'; -@forward 'footer/footer'; -@forward 'layout-global'; -@forward 'marketing-layout/marketing-layout'; -@forward 'not-found'; -@forward 'sidenav'; -@forward 'top-menu'; + @forward 'content-layout/content-layout'; + @forward 'doc-viewer/doc-viewer'; + @forward 'footer/footer'; + @forward 'layout-global/layout-global'; + @forward 'marketing-layout/marketing-layout'; + @forward 'not-found/not-found'; + @forward 'sidenav/sidenav'; + @forward 'top-menu/top-menu'; diff --git a/aio/src/styles/1-layouts/_theme.scss b/aio/src/styles/1-layouts/_theme.scss new file mode 100644 index 0000000000..bbe01d264f --- /dev/null +++ b/aio/src/styles/1-layouts/_theme.scss @@ -0,0 +1,15 @@ +@use 'footer/footer-theme' as *; +@use 'layout-global/layout-global-theme' as *; +@use 'marketing-layout/marketing-layout-theme' as *; +@use 'not-found/not-found-theme' as *; +@use 'sidenav/sidenav-theme' as *; +@use 'top-menu/top-menu-theme' as *; + +@mixin layout-themes($theme) { + @include footer-theme($theme); + @include layout-global-theme($theme); + @include marketing-layout-theme($theme); + @include not-found-theme($theme); + @include sidenav-theme($theme); + @include top-menu-theme($theme); +} diff --git a/aio/src/styles/1-layouts/footer/_footer-theming.scss b/aio/src/styles/1-layouts/footer/_footer-theme.scss similarity index 93% rename from aio/src/styles/1-layouts/footer/_footer-theming.scss rename to aio/src/styles/1-layouts/footer/_footer-theme.scss index e7519fa1b3..b821b37abd 100644 --- a/aio/src/styles/1-layouts/footer/_footer-theming.scss +++ b/aio/src/styles/1-layouts/footer/_footer-theme.scss @@ -8,19 +8,19 @@ footer { background-color: $blue; - - aio-footer { + + aio-footer { & > * { color: $white; } - + a { color: $white; } - + h3 { color: $white; } } } -} \ No newline at end of file +} diff --git a/aio/src/styles/1-layouts/footer/_footer.scss b/aio/src/styles/1-layouts/footer/_footer.scss index a73b925a98..9e1e87099c 100644 --- a/aio/src/styles/1-layouts/footer/_footer.scss +++ b/aio/src/styles/1-layouts/footer/_footer.scss @@ -1,4 +1,4 @@ -@use '../../constants'; +@use '../../constants' as *; @use '../../mixins' as *; footer { @@ -37,7 +37,7 @@ footer { &:focus { // `outline-offset` is not applied on Chrome on Windows, if `outline-style` is `auto. - outline: 1px solid rgba(constants.$white, 0.8); + outline: 1px solid rgba($white, 0.8); outline-offset: 2px; } } diff --git a/aio/src/styles/1-layouts/layout-global/_layout-global-theme.scss b/aio/src/styles/1-layouts/layout-global/_layout-global-theme.scss new file mode 100644 index 0000000000..2540745739 --- /dev/null +++ b/aio/src/styles/1-layouts/layout-global/_layout-global-theme.scss @@ -0,0 +1,15 @@ +@use '../../constants' as *; +@use '~@angular/material/theming' as *; + +@mixin layout-global-theme($theme) { + $primary: map-get($theme, primary); + $background: map-get($theme, background); + $foreground: map-get($theme, foreground); + $is-dark-theme: map-get($theme, is-dark); + + html, + body, + .content { + background: if($is-dark-theme, mat-color($background, background), $white); + } +} diff --git a/aio/src/styles/1-layouts/_layout-global.scss b/aio/src/styles/1-layouts/layout-global/_layout-global.scss similarity index 86% rename from aio/src/styles/1-layouts/_layout-global.scss rename to aio/src/styles/1-layouts/layout-global/_layout-global.scss index 4ca431e950..1d2f10f2ae 100644 --- a/aio/src/styles/1-layouts/_layout-global.scss +++ b/aio/src/styles/1-layouts/layout-global/_layout-global.scss @@ -1,14 +1,7 @@ -@use '../constants' as *; - html, body { height: 100%; } -body, -.content { - background-color: $white; -} - .center-layout { margin: 0 auto; max-width: 62.5em; diff --git a/aio/src/styles/1-layouts/marketing-layout/_marketing-layout-theme.scss b/aio/src/styles/1-layouts/marketing-layout/_marketing-layout-theme.scss index f31b19bada..dd121ffdd6 100644 --- a/aio/src/styles/1-layouts/marketing-layout/_marketing-layout-theme.scss +++ b/aio/src/styles/1-layouts/marketing-layout/_marketing-layout-theme.scss @@ -1,4 +1,5 @@ @use '../../constants' as *; +@use '~@angular/material/theming' as *; @mixin marketing-layout-theme($theme) { $primary: map-get($theme, primary); @@ -14,28 +15,38 @@ section#intro { color: $white; + + @if $is-dark-theme { + .hero-logo { + img { + filter: brightness(1.1); + } + } + } } .announcement-bar { background-color: $white; - + .button { color: $white; background-color: $blue; - + &:hover { color: rgba($white, 0.7); } } } - .home-row .card { - .card-text-container { + .home-row .card { + background-color: if($is-dark-theme, $darkgray, $white); + + .card-text-container { p { color: if($is-dark-theme, $offwhite, $darkgray); } } - + &:hover { h2 { color: $blue; @@ -64,6 +75,4 @@ color: $white; } } - } - diff --git a/aio/src/styles/1-layouts/not-found/_not-found-theme.scss b/aio/src/styles/1-layouts/not-found/_not-found-theme.scss new file mode 100644 index 0000000000..bbf85e4cd8 --- /dev/null +++ b/aio/src/styles/1-layouts/not-found/_not-found-theme.scss @@ -0,0 +1,19 @@ +@use '../../constants' as *; +@use '~@angular/material/theming' as *; + +@mixin not-found-theme($theme) { + $primary: map-get($theme, primary); + $background: map-get($theme, background); + $foreground: map-get($theme, foreground); + $is-dark-theme: map-get($theme, is-dark); + + .nf-response { + h1 { + color: $blue; + } + } + + .nf-icon.material-icons { + color: $blue; + } +} diff --git a/aio/src/styles/1-layouts/_not-found.scss b/aio/src/styles/1-layouts/not-found/_not-found.scss similarity index 71% rename from aio/src/styles/1-layouts/_not-found.scss rename to aio/src/styles/1-layouts/not-found/_not-found.scss index 7e442e1831..1dba303b4f 100644 --- a/aio/src/styles/1-layouts/_not-found.scss +++ b/aio/src/styles/1-layouts/not-found/_not-found.scss @@ -1,5 +1,5 @@ -@use '../constants' as *; -@use '../mixins' as *; +@use '../../constants' as *; +@use '../../mixins' as *; .nf-container { align-items: center; @@ -12,15 +12,13 @@ flex-direction: column; h1 { - @include font-size(48); - color: $blue; + @include font-size(48); text-transform: uppercase; margin: 8px 0; } } .nf-icon.material-icons { - color: $blue; @include font-size(100); position: static; } diff --git a/aio/src/styles/1-layouts/sidenav/_sidenav-theme.scss b/aio/src/styles/1-layouts/sidenav/_sidenav-theme.scss new file mode 100644 index 0000000000..4c533cb2b7 --- /dev/null +++ b/aio/src/styles/1-layouts/sidenav/_sidenav-theme.scss @@ -0,0 +1,44 @@ +@use '../../constants' as *; +@use '~@angular/material/theming' as *; + +@mixin sidenav-theme($theme) { + $primary: map-get($theme, primary); + $background: map-get($theme, background); + $foreground: map-get($theme, foreground); + $is-dark-theme: map-get($theme, is-dark); + + mat-sidenav-container.sidenav-container { + background-color: if($is-dark-theme, mat-color($background, background), $white); + + mat-sidenav.sidenav { + background-color: if($is-dark-theme, $deepgray, $superlightgray); + border-right: 1px solid if($is-dark-theme, $darkgray, $lightgray); + + .doc-version { + border-top: 1px solid if($is-dark-theme, $darkgray, $lightgray); + } + } + } + + aio-nav-menu { + aio-nav-item { + .vertical-menu-item { + color: if($is-dark-theme, $offwhite, $darkgray); + + &:hover { + background-color: if($is-dark-theme, $darkgray, $lightgray); + color: if($is-dark-theme, $powderblue, $blue); + text-shadow: 0 0 5px if($is-dark-theme, $black, $white); + + &.selected { + color: if($is-dark-theme, $powderblue, $darkblue); + } + } + + &.selected { + color: if($is-dark-theme, $lightblue, $darkblue); + } + } + } + } +} diff --git a/aio/src/styles/1-layouts/_sidenav.scss b/aio/src/styles/1-layouts/sidenav/_sidenav.scss similarity index 88% rename from aio/src/styles/1-layouts/_sidenav.scss rename to aio/src/styles/1-layouts/sidenav/_sidenav.scss index 68fe957d47..dd4651c379 100644 --- a/aio/src/styles/1-layouts/_sidenav.scss +++ b/aio/src/styles/1-layouts/sidenav/_sidenav.scss @@ -1,5 +1,5 @@ -@use '../constants' as *; -@use '../mixins' as *; +@use '../../constants' as *; +@use '../../mixins' as *; // Disable sidenav animations for the initial render. .starting.mat-drawer-transition .mat-drawer-content { @@ -7,7 +7,6 @@ } mat-sidenav-container.sidenav-container { - background-color: $white; min-height: 100%; height: auto !important; max-width: 100%; @@ -28,8 +27,6 @@ mat-sidenav-container.sidenav-container { bottom: 0; left: 0; min-width: 260px; - background-color: $superlightgray; - border-right: 1px solid $lightgray; @media (max-width: 599px) { top: 56px; @@ -38,7 +35,6 @@ mat-sidenav-container.sidenav-container { // Angular Version Selector .doc-version { padding: 8px; - border-top: 1px solid $lightgray; } } } @@ -63,7 +59,6 @@ aio-nav-menu { aio-nav-item { .vertical-menu-item { box-sizing: border-box; - color: $darkgray; cursor: pointer; display: flex; align-items: center; @@ -75,20 +70,10 @@ aio-nav-menu { width: 100%; word-wrap: break-word; - &:hover { - background-color: $lightgray; - color: $blue; - text-shadow: 0 0 5px $white; - } - &:focus { outline: $focus-outline-onlight auto 2px; } - &.selected { - color: $darkblue; - } - span { padding-right: 32px; } diff --git a/aio/src/styles/1-layouts/top-menu/_top-menu-theme.scss b/aio/src/styles/1-layouts/top-menu/_top-menu-theme.scss new file mode 100644 index 0000000000..467de58e7c --- /dev/null +++ b/aio/src/styles/1-layouts/top-menu/_top-menu-theme.scss @@ -0,0 +1,106 @@ +@use '../../constants' as *; +@use '../../mixins' as *; +@use '~@angular/material/theming' as *; + +@mixin top-menu-theme($theme) { + $primary: map-get($theme, primary); + $background: map-get($theme, background); + $foreground: map-get($theme, foreground); + $is-dark-theme: map-get($theme, is-dark); + + mat-toolbar.app-toolbar { + // HOME PAGE OVERRIDE: TOPNAV TOOLBAR + .page-home & { + background-color: $blue; + } + + mat-icon { + color: $white; + } + + // HAMBURGER BUTTON + .hamburger { + &:hover { + color: $offwhite; + } + + & .mat-icon { + color: $white; + } + } + + // HOME NAV-LINK + .nav-link.home { + &:focus { + // `outline-offset` is not applied on Chrome on Windows, if `outline-style` is `auto. + outline: 1px solid $focus-outline-ondark; + } + } + + // TOP MENU + aio-top-menu { + ul { + li { + a.nav-link { + .nav-link-inner { + &:hover { + background: rgba($white, 0.15); + } + } + + &:focus { + .nav-link-inner { + background: rgba($white, 0.15); + 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 { + input { + color: $darkgray; + background-color: $white; + + @include placeholder { + color: $mediumgray; + } + } + } + + // THEME PICKER + + aio-theme-picker { + button { + color: $offwhite; + } + } + + // EXTERNAL LINK ICONS + .toolbar-external-icons-container { + a { + &:focus { + // `outline-offset` is not applied on Chrome on Windows, if `outline-style` is `auto. + outline: 1px solid $focus-outline-ondark; + } + } + } + } +} diff --git a/aio/src/styles/1-layouts/_top-menu.scss b/aio/src/styles/1-layouts/top-menu/_top-menu.scss similarity index 82% rename from aio/src/styles/1-layouts/_top-menu.scss rename to aio/src/styles/1-layouts/top-menu/_top-menu.scss index 68a46e2a7e..5089497eb9 100644 --- a/aio/src/styles/1-layouts/_top-menu.scss +++ b/aio/src/styles/1-layouts/top-menu/_top-menu.scss @@ -1,5 +1,5 @@ -@use '../constants' as *; -@use '../mixins' as *; +@use '../../constants' as *; +@use '../../mixins' as *; // VARIABLES $showTopMenuWidth: 1048px; @@ -18,8 +18,6 @@ mat-toolbar.app-toolbar { // HOME PAGE OVERRIDE: TOPNAV TOOLBAR .page-home & { - background-color: $blue; - @media (min-width: 481px) { &:not(.transitioning) { background-color: transparent; @@ -44,10 +42,6 @@ mat-toolbar.app-toolbar { padding: 0 16px 0 0; } - mat-icon { - color: $white; - } - // HAMBURGER BUTTON .hamburger { height: 100%; @@ -70,12 +64,7 @@ mat-toolbar.app-toolbar { transition-timing-function: cubic-bezier(0.25, 0.8, 0.25, 1); } - &:hover { - color: $offwhite; - } - & .mat-icon { - color: $white; position: inherit; } } @@ -88,7 +77,6 @@ mat-toolbar.app-toolbar { &:focus { // `outline-offset` is not applied on Chrome on Windows, if `outline-style` is `auto. - outline: 1px solid $focus-outline-ondark; outline-offset: 4px; } @@ -146,33 +134,13 @@ mat-toolbar.app-toolbar { .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); } } } @@ -191,10 +159,8 @@ mat-toolbar.app-toolbar { margin-right: 16px; input { - color: $darkgray; border: none; border-radius: 100px; - background-color: $white; padding: 5px 16px; margin-left: 8px; width: 180px; @@ -208,7 +174,6 @@ mat-toolbar.app-toolbar { @include placeholder { @include font-size(14); - color: $mediumgray; } @media (min-width: 1000px) { @@ -239,8 +204,6 @@ mat-toolbar.app-toolbar { margin: 0 -16px; &:focus { - // `outline-offset` is not applied on Chrome on Windows, if `outline-style` is `auto. - outline: 1px solid $focus-outline-ondark; outline-offset: -16px; } diff --git a/aio/src/styles/_app-theme.scss b/aio/src/styles/_app-theme.scss index 9453008a6e..0792bccd9f 100644 --- a/aio/src/styles/_app-theme.scss +++ b/aio/src/styles/_app-theme.scss @@ -1,6 +1,7 @@ -@import '~@angular/material/theming'; -@import '1-layouts/marketing-layout/marketing-layout-theme'; +@use '0-base/typography-theme' as *; +@use '1-layouts' as *; @mixin app-theme($theme) { - @include marketing-layout-theme($theme); -} \ No newline at end of file + @include typography-theme($theme); + @include layout-theme($theme); +} diff --git a/aio/src/styles/custom-themes/dark.scss b/aio/src/styles/custom-themes/dark.scss index cbe2fc8d96..d7c54be771 100644 --- a/aio/src/styles/custom-themes/dark.scss +++ b/aio/src/styles/custom-themes/dark.scss @@ -1,9 +1,9 @@ -@import '../app-theme'; +@use '../app-theme' as *; +@use '~@angular/material/theming' as *; - -$ng-io-primary: mat-palette($mat-red, 700, 600, 800); -$ng-io-accent: mat-palette($mat-blue, 700, 600, 800); -$ng-io-warn: mat-palette($mat-blue); +$ng-io-primary: mat-palette($mat-blue, 700, 600, 800); +$ng-io-accent: mat-palette($mat-red, 700, 600, 800); +$ng-io-warn: mat-palette($mat-red); $ng-io-theme: mat-dark-theme($ng-io-primary, $ng-io-accent, $ng-io-warn); @include angular-material-theme($ng-io-theme); diff --git a/aio/src/styles/custom-themes/light.scss b/aio/src/styles/custom-themes/light.scss index 4f1eeaaac6..0c8a4b467f 100644 --- a/aio/src/styles/custom-themes/light.scss +++ b/aio/src/styles/custom-themes/light.scss @@ -1,4 +1,5 @@ -@import '../app-theme'; +@use '../app-theme' as *; +@use '~@angular/material/theming' as *; $ng-io-primary: mat-palette($mat-blue, 700, 600, 800); diff --git a/aio/src/styles/main.scss b/aio/src/styles/main.scss index 5a8df08636..b599004d00 100755 --- a/aio/src/styles/main.scss +++ b/aio/src/styles/main.scss @@ -6,4 +6,4 @@ @use './2-modules' as modules; // import print styles -@import './print'; +@use './print'; diff --git a/aio/src/styles/ng-io-theme.scss b/aio/src/styles/ng-io-theme.scss index 45f5071d27..1e6531aab2 100644 --- a/aio/src/styles/ng-io-theme.scss +++ b/aio/src/styles/ng-io-theme.scss @@ -1,4 +1,4 @@ -@import '~@angular/material/theming'; +@use '~@angular/material/theming' as *; @import 'app-theme'; // Plus imports for other components in your app.