Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Commit

Permalink
fix(input): float labels support dir=rtl
Browse files Browse the repository at this point in the history
Closes #964.
  • Loading branch information
ThomasBurleson committed Apr 11, 2015
1 parent 0178b89 commit b88b744
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/input/input.scss
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ md-input-container {
-ms-flex-preferred-size: auto; //IE fix
}


label:not(.md-no-float),
.md-placeholder:not(.md-select-label) {
order: 1;
Expand All @@ -70,8 +71,9 @@ md-input-container {
padding-left: $input-container-padding;
z-index: 1;
transform: translate3d(0, $input-label-default-offset, 0) scale($input-label-default-scale);
transform-origin: left top;
transition: transform $swift-ease-out-timing-function 0.25s;

@include bidi-style(transform-origin, left top, transform-origin, right top);
}
.md-placeholder:not(.md-select-label) {
position: absolute;
Expand Down Expand Up @@ -184,6 +186,7 @@ md-input-container {
}
}


@media screen and (-ms-high-contrast: active) {
md-input-container.md-default-theme > md-icon {
fill: #fff;
Expand Down
11 changes: 11 additions & 0 deletions src/core/style/mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,14 @@
}
@return $map-str + '}';
}


/* mixin definition ; sets LTR and RTL within the same style call */
@mixin bidi-style($prop, $value, $inverse-prop, $default-value) {
#{$prop}: $value;

html[dir=rtl] & {
#{$inverse-prop}: $value;
#{$prop}: $default-value;
}
}

0 comments on commit b88b744

Please sign in to comment.