@@ -15,6 +15,11 @@ $mat-dialog-content-max-height: 65vh !default;
15
15
// don't expose this value as variable.
16
16
$mat-dialog-button-horizontal-margin : 8px !default ;
17
17
18
+ // Whether to emit fallback values for the structural styles. Previously MDC was emitting
19
+ // paddings in the static styles which meant that users would get them even if they didn't
20
+ // include the `dialog-base`. Eventually we should clean up the usages of this flag.
21
+ $_emit-fallbacks : true;
22
+
18
23
// Note that we disable fallback declarations, but we don't disable fallback
19
24
// values, because there are a lot of internal apps that don't include a proper
20
25
// theme in their tests.
@@ -55,21 +60,31 @@ $mat-dialog-button-horizontal-margin: 8px !default;
55
60
}
56
61
}
57
62
63
+ @mixin _use-mat-tokens {
64
+ @include mdc-helpers .disable-mdc-fallback-declarations {
65
+ @include token-utils .use-tokens (tokens-mat-dialog .$prefix ,
66
+ tokens-mat-dialog .get-token-slots ()) {
67
+ @content ;
68
+ }
69
+ }
70
+ }
71
+
58
72
// This needs extra specificity so it doesn't get overwritten by the CDK structural styles.
59
73
.cdk-overlay-pane.mat-mdc-dialog-panel {
60
- @include token-utils . use-tokens ( tokens- mat-dialog . $prefix , tokens-mat-dialog . get-token-slots ()) {
61
- @include token-utils .create-token-slot (max-width , container- max- width);
62
- @include token-utils .create-token-slot (min-width , container- min- width);
74
+ @include _use- mat-tokens {
75
+ @include token-utils .create-token-slot (max-width , container- max- width, $_emit-fallbacks );
76
+ @include token-utils .create-token-slot (min-width , container- min- width, $_emit-fallbacks );
63
77
64
78
@media (variables .$xsmall ) {
65
- @include token-utils .create-token-slot (max-width , container- small- max- width);
79
+ @include token-utils .create-token-slot (max-width , container- small- max- width,
80
+ $_emit-fallbacks );
66
81
}
67
82
}
68
83
}
69
84
70
85
.mat-mdc-dialog-title {
71
- @include token-utils . use-tokens ( tokens- mat-dialog . $prefix , tokens-mat-dialog . get-token-slots ()) {
72
- @include token-utils .create-token-slot (padding , headline- padding);
86
+ @include _use- mat-tokens {
87
+ @include token-utils .create-token-slot (padding , headline- padding, $_emit-fallbacks );
73
88
}
74
89
}
75
90
@@ -78,14 +93,17 @@ $mat-dialog-button-horizontal-margin: 8px !default;
78
93
.mat-mdc-dialog-content {
79
94
display : block ;
80
95
81
- @include token-utils . use-tokens ( tokens- mat-dialog . $prefix , tokens-mat-dialog . get-token-slots ()) {
96
+ @include _use- mat-tokens {
82
97
// These styles need a bit more specificity.
83
98
.mat-mdc-dialog-container & {
84
- @include token-utils .create-token-slot (padding , content- padding);
99
+ @include token-utils .create-token-slot (padding , content- padding, $_emit-fallbacks );
85
100
}
86
101
87
- .mat-mdc-dialog-container :has (.mat-mdc-dialog-actions ) & {
88
- @include token-utils .create-token-slot (padding , with- actions- content- padding);
102
+ // Note: we can achieve this with a `:has` selector, but it results in an
103
+ // increased specificity which breaks a lot of internal clients.
104
+ .mat-mdc-dialog-container-with-actions & {
105
+ @include token-utils .create-token-slot (padding , with- actions- content- padding,
106
+ $_emit-fallbacks );
89
107
}
90
108
}
91
109
@@ -97,9 +115,9 @@ $mat-dialog-button-horizontal-margin: 8px !default;
97
115
.mat-mdc-dialog-actions {
98
116
// For backwards compatibility, actions align at start by default. MDC usually
99
117
// aligns actions at the end of the container.
100
- @include token-utils . use-tokens ( tokens- mat-dialog . $prefix , tokens-mat-dialog . get-token-slots ()) {
101
- @include token-utils .create-token-slot (padding , actions- padding);
102
- @include token-utils .create-token-slot (justify-content , actions- alignment);
118
+ @include _use- mat-tokens {
119
+ @include token-utils .create-token-slot (padding , actions- padding, $_emit-fallbacks );
120
+ @include token-utils .create-token-slot (justify-content , actions- alignment, $_emit-fallbacks );
103
121
}
104
122
105
123
// .mat-mdc-dialog-actions-align-{start|center|end} are set by directive input "align"
0 commit comments