Skip to content

Commit 86c4a9d

Browse files
authored
fix(material/legacy-form-field): remove invalid selector (#25554)
We used to use `:placeholder-shown` to toggle some styles in the form field. In #8223 those selectors were changed to `:label-shown` which isn't a valid CSS selector. These changes remove the selector since it can cause errors in some tools. Fixes #24181.
1 parent cb78009 commit 86c4a9d

File tree

4 files changed

+5
-9
lines changed

4 files changed

+5
-9
lines changed

src/material/legacy-form-field/_form-field-fill-theme.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,7 @@ $fill-dedupe: 0;
9797

9898
// Server-side rendered matInput with a label attribute but label not shown
9999
// (used as a pure CSS stand-in for mat-form-field-should-float).
100-
.mat-input-server[label]:not(:label-shown) + .mat-form-field-label-wrapper
101-
.mat-form-field-label {
100+
.mat-input-server[label] + .mat-form-field-label-wrapper .mat-form-field-label {
102101
@include _label-floating(
103102
$subscript-font-scale, $infix-padding-top + $fill-appearance-label-offset,
104103
$infix-margin-top);

src/material/legacy-form-field/_form-field-legacy-theme.scss

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,7 @@ $legacy-dedupe: 0;
119119

120120
// Server-side rendered matInput with a label attribute but label not shown
121121
// (used as a pure CSS stand-in for mat-form-field-should-float).
122-
.mat-input-server[label]:not(:label-shown) + .mat-form-field-label-wrapper
123-
.mat-form-field-label {
122+
.mat-input-server[label] + .mat-form-field-label-wrapper .mat-form-field-label {
124123
@include _label-floating(
125124
$subscript-font-scale, $infix-padding, $infix-margin-top);
126125
}
@@ -165,7 +164,7 @@ $legacy-dedupe: 0;
165164

166165
// Server-side rendered matInput with a label attribute but label not shown
167166
// (used as a pure CSS stand-in for mat-form-field-should-float).
168-
.mat-input-server[label]:not(:label-shown) + .mat-form-field-label-wrapper
167+
.mat-input-server[label] + .mat-form-field-label-wrapper
169168
.mat-form-field-label {
170169
@include _label-floating-print(
171170
$subscript-font-scale, $infix-padding, $infix-margin-top);

src/material/legacy-form-field/_form-field-outline-theme.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,7 @@ $outline-dedupe: 0;
127127

128128
// Server-side rendered matInput with a label attribute but label not shown
129129
// (used as a pure CSS stand-in for mat-form-field-should-float).
130-
.mat-input-server[label]:not(:label-shown) + .mat-form-field-label-wrapper
131-
.mat-form-field-label {
130+
.mat-input-server[label] + .mat-form-field-label-wrapper .mat-form-field-label {
132131
@include _label-floating(
133132
$subscript-font-scale, $infix-padding + $outline-appearance-label-offset,
134133
$infix-margin-top);

src/material/legacy-form-field/_form-field-theme.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,7 @@ $dedupe: 0;
206206

207207
// Server-side rendered matInput with a label attribute but label not shown
208208
// (used as a pure CSS stand-in for mat-form-field-should-float).
209-
.mat-input-server[label]:not(:label-shown) + .mat-form-field-label-wrapper
210-
.mat-form-field-label {
209+
.mat-input-server[label] + .mat-form-field-label-wrapper .mat-form-field-label {
211210
@include _label-floating(
212211
$subscript-font-scale, $infix-padding, $infix-margin-top);
213212
}

0 commit comments

Comments
 (0)