Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(rtl): Adding noflip annotations to fix downstream rtl issues #2344

Merged
merged 6 commits into from
Mar 5, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
11 changes: 6 additions & 5 deletions packages/mdc-button/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

@import "@material/elevation/mixins";
@import "@material/ripple/mixins";
@import "@material/rtl/mixins";
@import "@material/theme/functions";
@import "@material/theme/mixins";
@import "@material/typography/mixins";
Expand Down Expand Up @@ -63,8 +64,8 @@
// Note: Adjust padding to maintain consistent width with non-stroked buttons
$padding-value: max($mdc-button-horizontal-padding - $stroke-width, 0);

padding-right: $padding-value;
padding-left: $padding-value;
@include mdc-rtl-reflexive-property(padding, $padding-value, $padding-value);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we doing this? This ends up adding more CSS for no gain in cases where both left and right have the same value.


border-width: $stroke-width;
// Note: line height is adjusted for stroke button because borders are not
// considered as space available to text on the Web
Expand All @@ -79,8 +80,7 @@
&.mdc-button--compact {
$padding-compact-value: max($mdc-compact-button-horizontal-padding - $stroke-width, 0);

padding-right: $padding-compact-value;
padding-left: $padding-compact-value;
@include mdc-rtl-reflexive-property(padding, $padding-compact-value, $padding-compact-value);
}
}

Expand Down Expand Up @@ -131,10 +131,11 @@
}

@mixin mdc-button__icon_ {
@include mdc-rtl-reflexive-box(margin, right, 8px);

display: inline-block;
width: 18px;
height: 18px;
margin-right: 8px;
font-size: 18px;
line-height: inherit;
vertical-align: top;
Expand Down
10 changes: 10 additions & 0 deletions packages/mdc-ripple/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,17 @@

&.mdc-ripple-upgraded::after {
top: 0;

/* @noflip */
left: 0;
transform: scale(0);
transform-origin: center center;
}

&.mdc-ripple-upgraded--unbounded::after {
top: var(--mdc-ripple-top, 0);

/* @noflip */
left: var(--mdc-ripple-left, 0);
}

Expand Down Expand Up @@ -170,6 +174,8 @@
&::before,
&::after {
top: calc(50% - #{$radius});

/* @noflip */
left: calc(50% - #{$radius});
width: $radius * 2;
height: $radius * 2;
Expand All @@ -179,6 +185,8 @@

&.mdc-ripple-upgraded::before {
top: calc(50% - #{$radius});

/* @noflip */
left: calc(50% - #{$radius});
width: $radius * 2;
height: $radius * 2;
Expand All @@ -187,6 +195,8 @@

&.mdc-ripple-upgraded--unbounded::before {
top: var(--mdc-ripple-top, calc(50% - #{$radius / 2}));

/* @noflip */
left: var(--mdc-ripple-left, calc(50% - #{$radius / 2}));
width: var(--mdc-ripple-fg-size, $radius);
height: var(--mdc-ripple-fg-size, $radius);
Expand Down
6 changes: 6 additions & 0 deletions packages/mdc-rtl/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,17 @@
$right-value,
$root-selector: null
) {
/* @noflip */
#{$left-property}: $left-value;

/* @noflip */
#{$right-property}: $right-value;

@include mdc-rtl($root-selector) {
/* @noflip */
#{$left-property}: $right-value;

/* @noflip */
#{$right-property}: $left-value;
}
}