Skip to content

Commit

Permalink
fix(material-experimental/mdc-core): add app background color
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 committed Jun 16, 2021
1 parent b57b686 commit 205a374
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 './option/option-theme';
@use './option/optgroup-theme';
Expand Down Expand Up @@ -28,6 +29,17 @@
@include elevation.private-theme-elevation($zValue, $color);
}
}

// 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($color, background);
$foreground: map.get($color, foreground);

background-color: theming.get-color-from-palette($background, background);
color: theming.get-color-from-palette($foreground, text);
}
}
}
}

0 comments on commit 205a374

Please sign in to comment.