From 94e384087b316a43544539bdefbd566095b8f110 Mon Sep 17 00:00:00 2001 From: Kristiyan Kostadinov Date: Wed, 16 Mar 2022 09:27:05 +0100 Subject: [PATCH] fix(material-experimental/mdc-core): add app background color Adds a `mat-mdc-app-background` utility class similar to `mat-app-background`. --- src/material-experimental/mdc-core/_core-theme.scss | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/material-experimental/mdc-core/_core-theme.scss b/src/material-experimental/mdc-core/_core-theme.scss index 03c97a6f4322..4f1452745954 100644 --- a/src/material-experimental/mdc-core/_core-theme.scss +++ b/src/material-experimental/mdc-core/_core-theme.scss @@ -1,3 +1,4 @@ +@use 'sass:map'; @use '../../material/core/theming/theming'; @use '../../material/core/typography/typography'; @use './option/option-theme'; @@ -23,6 +24,17 @@ @include elevation.private-theme-elevation($zValue, $config); } } + + // Wrapper element that provides the theme background when the user's content isn't + // inside of a `mat-sidenav-container`. Note that we need to exclude the ampersand + // selector in case the mixin is included at the top level. + .mat-mdc-app-background#{if(&, ', &.mat-mdc-app-background', '')} { + $background: map.get($config, background); + $foreground: map.get($config, foreground); + + background-color: theming.get-color-from-palette($background, background); + color: theming.get-color-from-palette($foreground, text); + } } }