Skip to content

Commit a2de246

Browse files
authored
Revert "feat(material-experimental/mdc-dialog): switch to new theming api (#23620)" (#24508)
This reverts commit 353a548.
1 parent 353a548 commit a2de246

File tree

2 files changed

+2
-70
lines changed

2 files changed

+2
-70
lines changed

src/material-experimental/mdc-dialog/_dialog-theme.scss

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,20 @@
1-
@use 'sass:map';
21
@use '@material/dialog' as mdc-dialog;
3-
@use '@material/dialog/dialog-theme' as mdc-dialog-theme;
4-
@use '@material/theme/theme-color' as mdc-theme-color;
5-
@use '@material/typography' as mdc-typography;
62
@use '../mdc-helpers/mdc-helpers';
73
@use '../../material/core/typography/typography';
84
@use '../../material/core/theming/theming';
95

106
@mixin color($config-or-theme) {
117
$config: theming.get-color-config($config-or-theme);
12-
138
@include mdc-helpers.mat-using-mdc-theme($config) {
14-
.mat-mdc-dialog-container {
15-
$surface: mdc-theme-color.$surface;
16-
$on-surface: mdc-theme-color.$on-surface;
17-
$text-emphasis-high: mdc-theme-color.text-emphasis(high);
18-
$text-emphasis-medium: mdc-theme-color.text-emphasis(medium);
19-
20-
@include mdc-dialog-theme.theme((
21-
container-color: $surface,
22-
container-elevation: 24,
23-
container-shadow-color: $on-surface,
24-
with-divider-divider-color: rgba($on-surface, mdc-dialog.$scroll-divider-opacity),
25-
subhead-color: rgba($on-surface, $text-emphasis-high),
26-
supporting-text-color: rgba($on-surface, $text-emphasis-medium),
27-
));
28-
}
9+
@include mdc-dialog.core-styles($query: mdc-helpers.$mat-theme-styles-query);
2910
}
3011
}
3112

3213
@mixin typography($config-or-theme) {
3314
$config: typography.private-typography-to-2018-config(
3415
theming.get-typography-config($config-or-theme));
3516
@include mdc-helpers.mat-using-mdc-typography($config) {
36-
.mat-mdc-dialog-container {
37-
$styles: mdc-typography.$styles;
38-
$headline6: map.get($styles, headline6);
39-
40-
@include mdc-dialog-theme.theme((
41-
subhead-font: map.get($headline6, font-family),
42-
subhead-line-height: map.get($styles, headline6, line-height),
43-
subhead-size: map.get($styles, headline6, font-size),
44-
subhead-weight: map.get($styles, headline6, font-weight),
45-
subhead-tracking: map.get($styles, headline6, letter-spacing),
46-
47-
supporting-text-font: map.get($styles, body1, font-family),
48-
supporting-text-line-height: map.get($styles, body1, line-height),
49-
supporting-text-size: map.get($styles, body1, font-size),
50-
supporting-text-weight: map.get($styles, body1, font-weight),
51-
supporting-text-tracking: map.get($styles, body1, letter-spacing),
52-
));
53-
}
17+
@include mdc-dialog.core-styles($query: mdc-helpers.$mat-typography-styles-query);
5418
}
5519
}
5620

src/material-experimental/mdc-dialog/dialog.scss

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,7 @@
11
@use '@material/dialog' as mdc-dialog;
2-
@use '@material/dialog/dialog-theme' as mdc-dialog-theme;
32
@use '../mdc-helpers/mdc-helpers';
43
@use './mdc-dialog-structure-overrides';
54

6-
// Theme map with values for variables that will be overriden in the theme.
7-
// MDC's theming system requires non-null values for the slots to be inserted
8-
// and included as default values.
9-
$_dialog-initial-theme: (
10-
// Color
11-
container-color: white,
12-
container-elevation: 24,
13-
container-shadow-color: black,
14-
with-divider-divider-color: black,
15-
subhead-color: black,
16-
supporting-text-color: black,
17-
18-
// Typography
19-
subhead-font: 'Arial',
20-
subhead-line-height: 14px,
21-
subhead-size: 14px,
22-
subhead-weight: 500,
23-
subhead-tracking: 1px,
24-
supporting-text-font: 'Arial',
25-
supporting-text-line-height: 14px,
26-
supporting-text-size: 14px,
27-
supporting-text-weight: 500,
28-
supporting-text-tracking: 1px,
29-
);
30-
315
// Dialog content max height. This has been copied from the standard dialog
326
// and is needed to make the dialog content scrollable.
337
$mat-dialog-content-max-height: 65vh !default;
@@ -42,12 +16,6 @@ $mat-dialog-button-horizontal-margin: 8px !default;
4216
@include mdc-dialog-structure-overrides.private-dialog-structure-overrides(
4317
$mat-dialog-content-max-height);
4418

45-
// Apply the theming slots to the container using an initial set of
46-
// values that will be overridden in the theme styles.
47-
.mat-mdc-dialog-container {
48-
@include mdc-dialog-theme.theme-styles($_dialog-initial-theme);
49-
}
50-
5119
// The dialog container is focusable. We remove the default outline shown in browsers.
5220
.mat-mdc-dialog-container {
5321
outline: 0;

0 commit comments

Comments
 (0)