Skip to content

Commit

Permalink
fix(material-experimental/mdc-checkbox): emitting fallback values for…
Browse files Browse the repository at this point in the history
… density CSS variables (#24184)

Fixes that the MDC checkbox density styles were emitting fallbacks for CSS variables.

(cherry picked from commit 177d904)
  • Loading branch information
crisbeto authored and andrewseguin committed Jan 13, 2022
1 parent 467ac02 commit fe39b55
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions src/material-experimental/mdc-checkbox/_checkbox-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,19 @@

@mixin density($config-or-theme) {
$density-scale: theming.get-density-config($config-or-theme);
.mat-mdc-checkbox .mdc-checkbox {
@include mdc-checkbox-theme.density(
$density-scale,
$query: mdc-helpers.$mat-base-styles-query
);
}

@if ($density-scale == -2 or $density-scale == 'minimum') {
.mat-mdc-checkbox-touch-target {
display: none;
@include mdc-helpers.disable-fallback-declarations {
.mat-mdc-checkbox .mdc-checkbox {
@include mdc-checkbox-theme.density(
$density-scale,
$query: mdc-helpers.$mat-base-styles-query
);
}

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

0 comments on commit fe39b55

Please sign in to comment.