Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

fix(textfield): Fix textarea label from overlapping border. #1715

Merged
merged 13 commits into from
Jan 10, 2018
Merged
2 changes: 2 additions & 0 deletions packages/mdc-textfield/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ $mdc-text-field-outlined-hover-border: rgba(black, .87);
$mdc-textarea-border-on-light: rgba(black, .73);
$mdc-textarea-border-on-dark: rgba(white, 1);
$mdc-textarea-light-background: rgba(white, 1);
// cannot be transparent because multiline textarea input
// will make text unreadable
$mdc-textarea-dark-background: rgba(48, 48, 48, 1);
$mdc-textarea-disabled-background-on-light: rgba(249, 249, 249, 1);
$mdc-textarea-disabled-background-on-dark: rgba(47, 47, 47, 1);
Expand Down
7 changes: 7 additions & 0 deletions packages/mdc-textfield/mdc-text-field.scss
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,7 @@
$label-offset-x: $padding-inset;

display: flex;
width: fit-content;
height: initial;
transition: none;
border: 1px solid $mdc-textarea-border-on-light;
Expand All @@ -497,6 +498,7 @@

// stylelint-disable plugin/selector-bem-pattern
.mdc-text-field__input {
margin: 0;
padding: $padding-inset;
padding-top: $padding-inset * 2;
border: 1px solid transparent;
Copy link

@havenchyk havenchyk Dec 8, 2017

Choose a reason for hiding this comment

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

I'm not 100% sure, but in active state (:focus) textarea should have 2px border (now it's a sum of 1px div border and 1px textarea border) and if you just remove this border from textarea, the whole border will become 1px

screencast 2017-12-08 15-39-06

Expand Down Expand Up @@ -531,6 +533,7 @@
bottom: auto;
padding: 8px 16px;
background-color: $mdc-textarea-light-background;
line-height: 1.15;

@include mdc-theme-dark(".mdc-text-field") {
background-color: $mdc-textarea-dark-background;
Expand Down Expand Up @@ -600,6 +603,10 @@
}
}

.mdc-text-field__input {
resize: vertical;
}

@include mdc-theme-dark {
border-bottom: 1px solid $mdc-text-field-divider-on-dark;
}
Expand Down