Skip to content

Commit

Permalink
fix(material-experimental/mdc-checkbox): reduce amount of emitted the…
Browse files Browse the repository at this point in the history
…me css

We were adding the ripple variables to the MDC checkbox theme, even though we weren't actually using it. These changes remove the variables which shaves off ~30kb from the theme.
  • Loading branch information
crisbeto committed Nov 23, 2021
1 parent 603b248 commit 2cb5c92
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions src/material-experimental/mdc-checkbox/_checkbox-theme.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
@use '@material/checkbox/checkbox' as mdc-checkbox;
@use '@material/checkbox/checkbox-theme' as mdc-checkbox-theme;
@use '@material/ripple/ripple-theme' as mdc-ripple-theme;
@use '@material/form-field' as mdc-form-field;
@use '@material/theme/theme-color' as mdc-theme-color;
@use '@material/theme/theme';
Expand All @@ -16,17 +15,10 @@
@mixin private-checkbox-styles-with-color($color) {
@include mdc-checkbox-theme.theme-deprecated(
(
density-scale: null,
checkmark-color: mdc-theme-color.prop-value(on-#{$color}),
container-checked-color: $color,
container-checked-hover-color: null,
container-disabled-color: rgba(mdc-theme-color.prop-value(on-surface), 0.38),
outline-color: rgba(mdc-theme-color.prop-value(on-surface), 0.54),
outline-hover-color: null,
ripple-color: mdc-theme-color.prop-value(on-surface),
ripple-opacity: mdc-ripple-theme.$dark-ink-opacities,
ripple-checked-color: $color,
ripple-checked-opacity: mdc-ripple-theme.$dark-ink-opacities,
)
);
}
Expand Down Expand Up @@ -71,7 +63,6 @@
);

.mat-mdc-checkbox {
@include private-checkbox-styles-with-color(primary);
@include mdc-form-field.core-styles($query: mdc-helpers.$mat-theme-styles-query);
@include ripple-theme.color((
foreground: (
Expand Down

0 comments on commit 2cb5c92

Please sign in to comment.