Skip to content

Commit

Permalink
fix(checkbox): Ensure correct positioning in RTL context (#381)
Browse files Browse the repository at this point in the history
Fixes #375
  • Loading branch information
traviskaufman committed Mar 4, 2017
1 parent 4bfda34 commit e296032
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
22 changes: 9 additions & 13 deletions packages/mdc-checkbox/mdc-checkbox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
//

@import "@material/animation/functions";
@import "@material/ripple/mixins";
@import "@material/animation/mixins";
@import "@material/ripple/mixins";
@import "@material/rtl/mixins";
@import "./variables";
@import "./keyframes";

Expand All @@ -40,16 +41,6 @@
left: 0;
}

@mixin mdc-checkbox-outer-box {
@include mdc-checkbox-cover-element;

top: ($mdc-checkbox-touch-area - $mdc-checkbox-size) / 2;
left: ($mdc-checkbox-touch-area - $mdc-checkbox-size) / 2;
border-radius: 2px;
box-sizing: border-box;
pointer-events: none;
}

// postcss-bem-linter: define checkbox
.mdc-checkbox {
@include mdc-ripple-base;
Expand Down Expand Up @@ -84,18 +75,23 @@
// stylelint-enable plugin/selector-bem-pattern

&__background {
@include mdc-checkbox-outer-box;
@include mdc-checkbox-cover-element;
@include mdc-rtl-reflexive-position(
left, ($mdc-checkbox-touch-area - $mdc-checkbox-size) / 2, ".mdc-checkbox");

display: inline-flex;
top: ($mdc-checkbox-touch-area - $mdc-checkbox-size) / 2;
align-items: center;
justify-content: center;
box-sizing: border-box;
pointer-events: none;
width: $mdc-checkbox-ui-pct;
height: $mdc-checkbox-ui-pct;
box-sizing: border-box;
transition:
mdc-checkbox-transition-exit(background-color),
mdc-checkbox-transition-exit(border-color);
border: $mdc-checkbox-border-width solid $mdc-checkbox-border-color;
border-radius: 2px;
background-color: transparent;
will-change: background-color, border-color;

Expand Down
1 change: 1 addition & 0 deletions packages/mdc-checkbox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"@material/animation": "^0.1.4",
"@material/base": "^0.1.2",
"@material/ripple": "^0.3.0",
"@material/rtl": "^0.1.2",
"@material/theme": "^0.1.2"
}
}

0 comments on commit e296032

Please sign in to comment.