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); + } } }