Skip to content

Commit

Permalink
fix(material-experimental/mdc-core): add app background color (#22992)
Browse files Browse the repository at this point in the history
Adds a `mat-mdc-app-background` utility class similar to `mat-app-background`.
  • Loading branch information
crisbeto authored Mar 16, 2022
1 parent 1199b39 commit 6982ca7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/material-experimental/mdc-core/_core-theme.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@use 'sass:map';
@use '../../material/core/theming/theming';
@use '../../material/core/typography/typography';
@use './option/option-theme';
Expand All @@ -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);
}
}
}

Expand Down

0 comments on commit 6982ca7

Please sign in to comment.