File tree Expand file tree Collapse file tree 4 files changed +41
-14
lines changed
src/material-experimental Expand file tree Collapse file tree 4 files changed +41
-14
lines changed Original file line number Diff line number Diff line change 5
5
@use ' @material/feature-targeting' as mdc-feature-targeting ;
6
6
@use ' @material/typography' as mdc-typography ;
7
7
@use ' @material/theme/theme-color' as mdc-theme-color ;
8
+ @use ' @material/theme/css' as mdc-theme-css ;
8
9
@use ' sass:map' ;
9
10
@use ' ../../material/core/theming/theming' ;
10
11
@use ' ../../material/core/typography/typography' ;
@@ -169,7 +170,9 @@ $mat-typography-mdc-level-mappings: (
169
170
);
170
171
171
172
// Apply given rules.
172
- @content ;
173
+ @include disable-fallback-declarations {
174
+ @content ;
175
+ }
173
176
174
177
// Reset the original values.
175
178
mdc-theme-color .$primary : $orig-primary ;
@@ -196,8 +199,18 @@ $mat-typography-mdc-level-mappings: (
196
199
}
197
200
198
201
// Apply given rules.
199
- @content ;
202
+ @include disable-fallback-declarations {
203
+ @content ;
204
+ }
200
205
201
206
// Reset the original values.
202
207
mdc-typography .$styles : $orig-mdc-typography-styles ;
203
208
}
209
+
210
+ // Disables MDC's CSS custom property fallbacks for the specified mixin content.
211
+ @mixin disable-fallback-declarations {
212
+ $previous-value : mdc-theme-css .$enable-fallback-declarations ;
213
+ mdc-theme-css .$enable-fallback-declarations : false;
214
+ @content ;
215
+ mdc-theme-css .$enable-fallback-declarations : $previous-value ;
216
+ }
Original file line number Diff line number Diff line change 6
6
@use ' ../../cdk/a11y' ;
7
7
@use ' ../../material/core/style/layout-common' ;
8
8
9
- @include mdc-radio .without-ripple ($query : mdc-helpers .$mat-base-styles-without-animation-query );
10
- @include mdc-form-field .core-styles ($query : mdc-helpers .$mat-base-styles-query );
9
+ @include mdc-helpers .disable-fallback-declarations {
10
+ @include mdc-radio .without-ripple ($query : mdc-helpers .$mat-base-styles-without-animation-query );
11
+ @include mdc-form-field .core-styles ($query : mdc-helpers .$mat-base-styles-query );
12
+ }
11
13
12
14
.mat-mdc-radio-button {
13
15
& :not (._mat-animation-noopable ) {
14
- @include mdc-radio .without-ripple ($query : animation );
16
+ @include mdc-helpers .disable-fallback-declarations {
17
+ @include mdc-radio .without-ripple ($query : animation );
18
+ }
15
19
}
16
20
17
21
.mdc-radio {
18
22
// MDC theme styles also include structural styles so we have to include the theme at least
19
23
// once here. The values will be overwritten by our own theme file afterwards.
20
- @include mdc-radio-theme .theme-styles (mdc-radio-theme .$light-theme );
24
+ @include mdc-helpers .disable-fallback-declarations {
25
+ @include mdc-radio-theme .theme-styles (mdc-radio-theme .$light-theme );
26
+ }
21
27
}
22
28
23
29
// This is necessary because we do not depend on MDC's ripple, but have our own that should be
35
41
36
42
// Element used to provide a larger tap target for users on touch devices.
37
43
.mat-mdc-radio-touch-target {
38
- @include mdc-touch-target .touch-target (
39
- $set-width : true,
40
- $query : mdc-helpers .$mat-base-styles-query );
44
+ @include mdc-helpers .disable-fallback-declarations {
45
+ @include mdc-touch-target .touch-target (
46
+ $set-width : true,
47
+ $query : mdc-helpers .$mat-base-styles-query );
48
+ }
41
49
42
50
[dir = ' rtl' ] & {
43
51
left : 0 ;
Original file line number Diff line number Diff line change 8
8
@use ' ../../material/core/style/layout-common' ;
9
9
@use ' ../../cdk/a11y' ;
10
10
11
- @include mdc-form-field .core-styles ($query : mdc-helpers .$mat-base-styles-query );
12
- @include mdc-switch .static-styles-without-ripple ;
11
+ @include mdc-helpers .disable-fallback-declarations {
12
+ @include mdc-form-field .core-styles ($query : mdc-helpers .$mat-base-styles-query );
13
+ @include mdc-switch .static-styles-without-ripple ;
14
+ }
13
15
14
16
.mat-mdc-slide-toggle {
15
17
display : inline-block ;
20
22
.mdc-switch {
21
23
// MDC theme styles also include structural styles so we have to include the theme at least
22
24
// once here. The values will be overwritten by our own theme file afterwards.
23
- @include mdc-switch-theme .theme-styles (mdc-switch-theme .$light-theme );
25
+ @include mdc-helpers .disable-fallback-declarations {
26
+ @include mdc-switch-theme .theme-styles (mdc-switch-theme .$light-theme );
27
+ }
24
28
}
25
29
26
30
// The ripple needs extra specificity so the base ripple styling doesn't override its `position`.
Original file line number Diff line number Diff line change @@ -10,8 +10,10 @@ $mat-tab-animation-duration: 500ms !default;
10
10
11
11
// Combines the various structural styles we need for the tab group and tab nav bar.
12
12
@mixin structural-styles {
13
- @include mdc-tab .without-ripple ($query : mdc-helpers .$mat-base-styles-query );
14
- @include mdc-tab-indicator .core-styles ($query : mdc-helpers .$mat-base-styles-query );
13
+ @include mdc-helpers .disable-fallback-declarations {
14
+ @include mdc-tab .without-ripple ($query : mdc-helpers .$mat-base-styles-query );
15
+ @include mdc-tab-indicator .core-styles ($query : mdc-helpers .$mat-base-styles-query );
16
+ }
15
17
16
18
.mat-mdc-tab-ripple {
17
19
position : absolute ;
You can’t perform that action at this time.
0 commit comments