Skip to content

Commit cf2703c

Browse files
jean-merelishansl
authored andcommittedJun 21, 2016
fix(input): Fix floating label width (#689)
Fix floating label to resize the width to use all available space Fixes #688.
1 parent f21b2f4 commit cf2703c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed
 

‎src/components/input/input.scss

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
@import 'mixins';
33
@import 'variables';
44

5+
$md-input-floating-placeholder-scale-factor: 0.75 !default;
56

67
// Placeholder colors. Required is used for the `*` star shown in the placeholder.
78
$md-input-placeholder-color: md-color($md-foreground, hint-text);
@@ -33,7 +34,8 @@ $md-input-underline-disabled-background-image: linear-gradient(to right,
3334
@mixin md-input-placeholder-floating {
3435
display: block;
3536
padding-bottom: 5px;
36-
transform: translateY(-100%) scale(0.75);
37+
transform: translateY(-100%) scale($md-input-floating-placeholder-scale-factor);
38+
width: 100% / $md-input-floating-placeholder-scale-factor;
3739

3840
.md-placeholder-required {
3941
color: $md-input-required-placeholder-color;
@@ -44,6 +46,7 @@ $md-input-underline-disabled-background-image: linear-gradient(to right,
4446
display: inline-block;
4547
position: relative;
4648
font-family: $md-font-family;
49+
overflow: hidden;
4750

4851
// To avoid problems with text-align.
4952
text-align: left;
@@ -119,7 +122,8 @@ $md-input-underline-disabled-background-image: linear-gradient(to right,
119122
transform-origin: bottom left;
120123
transition: transform $swift-ease-out-duration $swift-ease-out-timing-function,
121124
scale $swift-ease-out-duration $swift-ease-out-timing-function,
122-
color $swift-ease-out-duration $swift-ease-out-timing-function;
125+
color $swift-ease-out-duration $swift-ease-out-timing-function,
126+
width $swift-ease-out-duration $swift-ease-out-timing-function;
123127

124128
&.md-empty {
125129
display: block;

0 commit comments

Comments
 (0)
Please sign in to comment.