Skip to content

Commit

Permalink
fix(material/dialog): take dialog background from theme palette (#26324)
Browse files Browse the repository at this point in the history
We were using MDC's `surface` variable to set the background of the dialog, however the `surface` was being mapped to our `card` variable. In practice the values for both are the same, but the new behavior breaks apps with custom palettes.

Fixes #26272.

(cherry picked from commit 0e35cc0)
  • Loading branch information
crisbeto authored and mmalerba committed Jan 31, 2023
1 parent 2b04003 commit f1d83f1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/material/dialog/_dialog-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@

@mixin color($config-or-theme) {
$config: theming.get-color-config($config-or-theme);
$background: map.get($config, background);

@include mdc-helpers.using-mdc-theme($config) {
.mat-mdc-dialog-container {
$surface: mdc-theme-color.$surface;
$on-surface: mdc-theme-color.$on-surface;
$text-emphasis-high: mdc-theme-color.text-emphasis(high);
$text-emphasis-medium: mdc-theme-color.text-emphasis(medium);

@include mdc-dialog-theme.theme((
container-color: $surface,
container-color: theming.get-color-from-palette($background, dialog),
with-divider-divider-color: rgba($on-surface, mdc-dialog.$scroll-divider-opacity),
subhead-color: rgba($on-surface, $text-emphasis-high),
supporting-text-color: rgba($on-surface, $text-emphasis-medium),
Expand Down

0 comments on commit f1d83f1

Please sign in to comment.