Skip to content

Commit d7831d9

Browse files
mmalerbatinayuangao
authored andcommitted
fix(input): add more padding so that the hint doesn't overflow the container (#2246)
* fix(input): add more padding so that the hint does overflow the container also use em instead of px for some things so things don't overflow when using other font sizes. * remove useless transition
1 parent d9b2d85 commit d7831d9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/lib/input/input.scss

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ $md-input-underline-disabled-background-image:
1111
// Applies a floating placeholder above the input itself.
1212
@mixin md-input-placeholder-floating {
1313
display: block;
14-
padding-bottom: 5px;
15-
transform: translateY(-100%) scale($md-input-floating-placeholder-scale-factor);
14+
transform: translateY(-1.35em) scale($md-input-floating-placeholder-scale-factor);
1615
width: 100% / $md-input-floating-placeholder-scale-factor;
1716
}
1817

@@ -33,7 +32,9 @@ md-input, md-textarea {
3332
// Global wrapper. We need to apply margin to the element for spacing, but
3433
// cannot apply it to the host element directly.
3534
.md-input-wrapper {
36-
margin: 16px 0;
35+
margin: 1em 0;
36+
// Account for the underline which has 4px of margin + 2px of border.
37+
padding-bottom: 6px;
3738
}
3839

3940
// We use a table layout to baseline align the prefix and suffix classes.
@@ -122,7 +123,6 @@ md-input, md-textarea {
122123
transform: translateY(0);
123124
transform-origin: bottom left;
124125
transition: transform $swift-ease-out-duration $swift-ease-out-timing-function,
125-
scale $swift-ease-out-duration $swift-ease-out-timing-function,
126126
color $swift-ease-out-duration $swift-ease-out-timing-function,
127127
width $swift-ease-out-duration $swift-ease-out-timing-function;
128128

@@ -184,7 +184,7 @@ md-input, md-textarea {
184184
display: block;
185185
position: absolute;
186186
font-size: 75%;
187-
bottom: -0.5em;
187+
bottom: 0;
188188

189189
&.md-right {
190190
right: 0;

0 commit comments

Comments
 (0)