Skip to content

Commit 097ec0d

Browse files
committed
fix(material-experimental/mdc-core): add app background color (#22992)
Adds a `mat-mdc-app-background` utility class similar to `mat-app-background`. (cherry picked from commit 6982ca7)
1 parent 9c47b2b commit 097ec0d

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 '../../material/core/typography/typography';
34
@use './option/option-theme';
@@ -23,6 +24,17 @@
2324
@include elevation.private-theme-elevation($zValue, $config);
2425
}
2526
}
27+
28+
// Wrapper element that provides the theme background when the user's content isn't
29+
// inside of a `mat-sidenav-container`. Note that we need to exclude the ampersand
30+
// selector in case the mixin is included at the top level.
31+
.mat-mdc-app-background#{if(&, ', &.mat-mdc-app-background', '')} {
32+
$background: map.get($config, background);
33+
$foreground: map.get($config, foreground);
34+
35+
background-color: theming.get-color-from-palette($background, background);
36+
color: theming.get-color-from-palette($foreground, text);
37+
}
2638
}
2739
}
2840

0 commit comments

Comments
 (0)