Skip to content

Commit f1d83f1

Browse files
crisbetommalerba
authored andcommitted
fix(material/dialog): take dialog background from theme palette (#26324)
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)
1 parent 2b04003 commit f1d83f1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/material/dialog/_dialog-theme.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@
99

1010
@mixin color($config-or-theme) {
1111
$config: theming.get-color-config($config-or-theme);
12+
$background: map.get($config, background);
1213

1314
@include mdc-helpers.using-mdc-theme($config) {
1415
.mat-mdc-dialog-container {
15-
$surface: mdc-theme-color.$surface;
1616
$on-surface: mdc-theme-color.$on-surface;
1717
$text-emphasis-high: mdc-theme-color.text-emphasis(high);
1818
$text-emphasis-medium: mdc-theme-color.text-emphasis(medium);
1919

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

0 commit comments

Comments
 (0)