Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@use 'sass:map';
@use '@material/ripple/ripple-theme' as mdc-ripple-theme;
@use '@material/theme/theme-color' as mdc-theme-color;
@use '../mdc-core/mdc-helpers/mdc-helpers';

@mixin _ripple-color($color) {
--mat-mdc-button-persistent-ripple-color: #{$color};
Expand Down Expand Up @@ -53,7 +54,7 @@

// Hides the touch target on lower densities.
@mixin touch-target-density($scale) {
@if ($scale == -2 or $scale == 'minimum') {
@include mdc-helpers.if-touch-targets-unsupported($scale) {
.mat-mdc-button-touch-target {
display: none;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
);
}

@if ($density-scale == -2 or $density-scale == 'minimum') {
@include mdc-helpers.if-touch-targets-unsupported($density-scale) {
.mat-mdc-checkbox-touch-target {
display: none;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
@use '@material/theme/theme-color' as mdc-theme-color;
@use '@material/theme/css' as mdc-theme-css;
@use 'sass:map';
@use 'sass:meta';

// A set of standard queries to use with MDC's queryable mixins.
$mat-base-styles-query: mdc-feature-targeting.without(mdc-feature-targeting.any(color, typography));
Expand Down Expand Up @@ -211,3 +212,10 @@ $mat-typography-mdc-level-mappings: (
@content;
mdc-theme-css.$enable-fallback-declarations: $previous-value;
}

// Excludes the passed-in CSS content if the layout is too dense to supports touch targets.
@mixin if-touch-targets-unsupported($scale) {
@if ($scale == 'minimum' or (meta.type-of($scale) == 'number' and $scale < -1)) {
@content;
}
}
2 changes: 1 addition & 1 deletion src/material-experimental/mdc-radio/_radio-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
@include mdc-radio-theme.density($density-scale, $query: mdc-helpers.$mat-base-styles-query);
}

@if ($density-scale == -2 or $density-scale == 'minimum') {
@include mdc-helpers.if-touch-targets-unsupported($density-scale) {
.mat-mdc-radio-touch-target {
display: none;
}
Expand Down