Skip to content

Commit 205a374

Browse files
committed
fix(material-experimental/mdc-core): add app background color
Adds a `mat-mdc-app-background` utility class similar to `mat-app-background`.
1 parent b57b686 commit 205a374

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/material-experimental/mdc-core/_core-theme.scss

+12
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@use 'sass:map';
12
@use '../../material/core/theming/theming';
23
@use './option/option-theme';
34
@use './option/optgroup-theme';
@@ -28,6 +29,17 @@
2829
@include elevation.private-theme-elevation($zValue, $color);
2930
}
3031
}
32+
33+
// Wrapper element that provides the theme background when the user's content isn't
34+
// inside of a `mat-sidenav-container`. Note that we need to exclude the ampersand
35+
// selector in case the mixin is included at the top level.
36+
.mat-mdc-app-background#{if(&, ', &.mat-mdc-app-background', '')} {
37+
$background: map.get($color, background);
38+
$foreground: map.get($color, foreground);
39+
40+
background-color: theming.get-color-from-palette($background, background);
41+
color: theming.get-color-from-palette($foreground, text);
42+
}
3143
}
3244
}
3345
}

0 commit comments

Comments
 (0)