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

Commit 6ada786

Browse files
authored
fix(text-field): Update outline and label styles according to spec (#1855)
1 parent 2f9dd6f commit 6ada786

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

packages/mdc-textfield/_variables.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ $mdc-text-field-dark-background: rgba(48, 48, 48, 1);
3434
$mdc-text-field-dark-label: rgba(white, .6);
3535
$mdc-text-field-dark-placeholder: rgba(white, .3);
3636
$mdc-text-field-light-background: rgba(white, 1);
37-
$mdc-text-field-light-label: rgba(white, .7);
37+
$mdc-text-field-light-label: rgba(black, .6);
3838
$mdc-text-field-light-placeholder: rgba(black, .38);
3939

4040
$mdc-text-field-box-background: rgba(black, .04);

packages/mdc-textfield/label/mdc-text-field-label.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
left: 0;
3030
transform-origin: left top;
3131
transition: mdc-text-field-transition(transform), mdc-text-field-transition(color);
32-
color: $mdc-text-field-underline-on-light-idle;
32+
color: $mdc-text-field-light-label;
3333
cursor: text;
3434

3535
// stylelint-disable plugin/selector-bem-pattern

packages/mdc-textfield/mdc-text-field.scss

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,6 @@
147147
z-index: 2;
148148

149149
&--float-above {
150-
@include mdc-theme-prop(color, primary);
151-
152150
transform: scale(.75) translateY(-170%);
153151

154152
&.mdc-text-field__label--shake {
@@ -173,6 +171,17 @@
173171
stroke-width: 2px;
174172
}
175173

174+
&:not(.mdc-text-field--invalid) {
175+
&.mdc-text-field--focused .mdc-text-field__label {
176+
@include mdc-theme-prop(color, primary);
177+
}
178+
179+
// stylelint-disable-next-line selector-max-specificity
180+
.mdc-text-field__input:hover ~ .mdc-text-field__outline .mdc-text-field__outline-path {
181+
stroke: $mdc-text-field-outlined-hover-border;
182+
}
183+
}
184+
176185
&.mdc-text-field--disabled {
177186
@include mdc-theme-prop(color, $mdc-text-field-light-placeholder);
178187

0 commit comments

Comments
 (0)