File tree Expand file tree Collapse file tree 4 files changed +12
-3
lines changed
src/material-experimental Expand file tree Collapse file tree 4 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 1
1
@use ' sass:map' ;
2
2
@use ' @material/ripple/ripple-theme' as mdc-ripple-theme ;
3
3
@use ' @material/theme/theme-color' as mdc-theme-color ;
4
+ @use ' ../mdc-core/mdc-helpers/mdc-helpers' ;
4
5
5
6
@mixin _ripple-color ($color ) {
6
7
--mat-mdc-button-persistent-ripple-color : #{$color } ;
53
54
54
55
// Hides the touch target on lower densities.
55
56
@mixin touch-target-density ($scale ) {
56
- @if ($scale == -2 or $scale == ' minimum ' ) {
57
+ @include mdc-helpers . if-touch-targets-unsupported ($scale ) {
57
58
.mat-mdc-button-touch-target {
58
59
display : none ;
59
60
}
Original file line number Diff line number Diff line change 88
88
);
89
89
}
90
90
91
- @if ( $density-scale == -2 or $density-scale == ' minimum ' ) {
91
+ @include mdc-helpers . if-touch-targets-unsupported ( $density-scale ) {
92
92
.mat-mdc-checkbox-touch-target {
93
93
display : none ;
94
94
}
Original file line number Diff line number Diff line change 7
7
@use ' @material/theme/theme-color' as mdc-theme-color ;
8
8
@use ' @material/theme/css' as mdc-theme-css ;
9
9
@use ' sass:map' ;
10
+ @use ' sass:meta' ;
10
11
11
12
// A set of standard queries to use with MDC's queryable mixins.
12
13
$mat-base-styles-query : mdc-feature-targeting .without (mdc-feature-targeting .any (color , typography ));
@@ -211,3 +212,10 @@ $mat-typography-mdc-level-mappings: (
211
212
@content ;
212
213
mdc-theme-css .$enable-fallback-declarations : $previous-value ;
213
214
}
215
+
216
+ // Excludes the passed-in CSS content if the layout is too dense to supports touch targets.
217
+ @mixin if-touch-targets-unsupported ($scale ) {
218
+ @if ($scale == ' minimum' or (meta .type-of ($scale ) == ' number' and $scale < -1 )) {
219
+ @content ;
220
+ }
221
+ }
Original file line number Diff line number Diff line change 77
77
@include mdc-radio-theme .density ($density-scale , $query : mdc-helpers .$mat-base-styles-query );
78
78
}
79
79
80
- @if ( $density-scale == -2 or $density-scale == ' minimum ' ) {
80
+ @include mdc-helpers . if-touch-targets-unsupported ( $density-scale ) {
81
81
.mat-mdc-radio-touch-target {
82
82
display : none ;
83
83
}
You can’t perform that action at this time.
0 commit comments