Skip to content

Commit 0ec71cd

Browse files
sijavbrandyscarney
authored andcommitted
feat(label): fix positioning of floating label for rtl (#11324)
* floating label rtl fix add rtl fix to floating label * single block, not nesting * fix(floating-label): wp and ios issue for rtl problems with transform-origin with both windows and ios platform for rtl and also wrong translate3d for rtl for windows platform * style(floating-label): remove html, 2 space indent remove reference of "html", just plain '[dir="rtl"] indent 2 space instead of 4 * refactor(floating-label): remove duplicate rule remove unnecessary duplicate rule
1 parent cc1eb02 commit 0ec71cd

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

src/components/label/label.ios.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ $label-ios-margin: $item-ios-padding-top ($item-ios-padding-right /
4444
transition: transform 150ms ease-in-out;
4545
}
4646

47+
[dir="rtl"] .label-ios[floating] {
48+
transform-origin: right top;
49+
}
50+
4751
.input-has-focus .label-ios[floating],
4852
.input-has-value .label-ios[floating] {
4953
transform: translate3d(0, 0, 0) scale(.8);

src/components/label/label.md.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ $label-md-margin: $item-md-padding-top ($item-md-padding-rig
4848
transition: transform 150ms ease-in-out;
4949
}
5050

51+
[dir="rtl"] .label-md[floating] {
52+
transform-origin: right top;
53+
}
54+
5155
.label-md[stacked],
5256
.label-md[floating] {
5357
margin-bottom: 0;

src/components/label/label.wp.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ $label-wp-text-color-focused: color($colors-wp, primary) !default;
4040
transform-origin: left top;
4141
}
4242

43+
[dir="rtl"] .label-wp[floating] {
44+
transform: translate3d(-8px, 34px, 0);
45+
transform-origin: right top;
46+
}
47+
4348
.label-wp[stacked],
4449
.label-wp[floating] {
4550
margin-bottom: 0;

0 commit comments

Comments
 (0)