Skip to content

Commit

Permalink
fix(checkbox): Respect BEM when outputting the base stylesheet (#1733)
Browse files Browse the repository at this point in the history
  • Loading branch information
lynnmercier authored Dec 12, 2017
1 parent e483aae commit 3e9bd5f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions demos/checkbox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
@import "../packages/mdc-theme/color-palette";
@import "../packages/mdc-theme/mixins";

.mdc-checkbox.demo-checkbox--custom-all {
.demo-checkbox--custom-all {
$color: $material-color-red-500;

@include mdc-checkbox-focus-indicator-color($color);
Expand All @@ -41,7 +41,7 @@
}
}

.mdc-checkbox.demo-checkbox--custom-stroke-and-fill {
.demo-checkbox--custom-stroke-and-fill {
@include mdc-checkbox-container-colors(
$unmarked-stroke-color: $material-color-blue-500,
$marked-fill-color: $material-color-purple-500);
Expand Down
9 changes: 6 additions & 3 deletions packages/mdc-checkbox/mdc-checkbox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,21 @@

.mdc-checkbox {
@include mdc-checkbox-base_;
@include mdc-checkbox-ink-color($mdc-checkbox-mark-color);
@include mdc-checkbox-focus-indicator-color($mdc-checkbox-baseline-theme-color);
@include mdc-ripple-surface;
@include mdc-states($mdc-checkbox-baseline-theme-color);
@include mdc-ripple-radius($mdc-checkbox-ripple-radius);
@include mdc-checkbox-container-colors();

@include mdc-theme-dark {
@include mdc-checkbox-container-colors($unmarked-stroke-color: $mdc-checkbox-border-color-dark);
}
}

@at-root {
@include mdc-checkbox-ink-color($mdc-checkbox-mark-color);
@include mdc-checkbox-focus-indicator-color($mdc-checkbox-baseline-theme-color);
@include mdc-checkbox-container-colors;
}

// Needed to disable hover effects on CSS-only (non-JS) checkboxes
.mdc-checkbox--disabled {
@include mdc-checkbox--disabled_;
Expand Down

0 comments on commit 3e9bd5f

Please sign in to comment.