@@ -8,7 +8,7 @@ $active-border-width: rem(2px) !default;
88$fs : rem (16px ) !default ;
99
1010%label {
11- translate : 0 calc ( var ( --label-position ) * -1 ) ;
11+ translate : 0 -50 % ;
1212}
1313
1414%floated-styles {
@@ -50,8 +50,8 @@ $fs: rem(16px) !default;
5050
5151input :placeholder-shown + [part = ' notch' ] [part = ' label' ],
5252[part ~= ' filled' ] + [part = ' notch' ] [part = ' label' ] {
53- @extend %label ;
5453 @include type-style (' caption' );
54+ @extend %label ;
5555}
5656
5757[part ~= ' input' ] {
@@ -138,13 +138,25 @@ input:placeholder-shown + [part='notch'] [part='label'],
138138
139139:host (:focus-within ) {
140140 [part = ' label' ] {
141- @extend %label ;
141+ color : var-get ($theme , ' focused-secondary-color' );
142+ }
143+ }
144+
145+ :host (:not ([readonly ]):focus-within ) {
146+ [part = ' label' ] {
142147 @include type-style (' caption' );
148+ }
149+ }
143150
144- color : var-get ($theme , ' focused-secondary-color' );
151+ :host ([outlined ]:not ([readonly ]):focus-within ) {
152+ [part = ' label' ] {
153+ @extend %label ;
154+
155+ align-self : start ;
145156 }
146157}
147158
159+
148160:host ([readonly ]:not ([outlined ]):focus-within ) {
149161 :not ([part ~= ' filled' ]) {
150162 input :not (:placeholder-shown ) + [part = ' notch' ] [part = ' label' ] {
@@ -245,7 +257,7 @@ input:placeholder-shown + [part='notch'] [part='label'],
245257 }
246258 }
247259
248- [part = ' notch ' ] [ part = ' label' ] {
260+ [part = ' label' ] {
249261 translate : 0 -73% ;
250262 }
251263}
@@ -386,8 +398,6 @@ input:placeholder-shown + [part='notch'] [part='label'],
386398}
387399
388400:host ([outlined ]) {
389- --label-position : calc ((#{var-get ($theme , ' size' )} / 2 ) - (#{$idle-border-width } ));
390-
391401 [part = ' notch' ] {
392402 border : {
393403 width : $idle-border-width ;
@@ -398,8 +408,18 @@ input:placeholder-shown + [part='notch'] [part='label'],
398408 }
399409 }
400410
411+ & :has (input :placeholder-shown ) {
412+ [part = ' label' ] {
413+ align-self : start ;
414+ }
415+ }
416+
401417 [part ~= ' filled' ] + [part = ' notch' ] {
402418 @extend %floated-styles ;
419+
420+ [part = ' label' ] {
421+ align-self : start ;
422+ }
403423 }
404424}
405425
@@ -460,10 +480,6 @@ input:placeholder-shown + [part='notch'] [part='label'],
460480}
461481
462482:host (:not ([type = ' search' ])[outlined ]:focus-within ) {
463- [part = ' label' ] {
464- margin-block-start : calc (#{$active-border-width } / 2 );
465- }
466-
467483 [part = ' start' ] {
468484 border : {
469485 color : var-get ($theme , ' focused-border-color' );
0 commit comments