Skip to content

Commit

Permalink
fix(material/legacy-form-field): remove invalid selector (#25554)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
crisbeto committed Sep 1, 2022
1 parent cb78009 commit 86c4a9d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
3 changes: 1 addition & 2 deletions src/material/legacy-form-field/_form-field-fill-theme.scss
Expand Up @@ -97,8 +97,7 @@ $fill-dedupe: 0;

// Server-side rendered matInput with a label attribute but label not shown
// (used as a pure CSS stand-in for mat-form-field-should-float).
.mat-input-server[label]:not(:label-shown) + .mat-form-field-label-wrapper
.mat-form-field-label {
.mat-input-server[label] + .mat-form-field-label-wrapper .mat-form-field-label {
@include _label-floating(
$subscript-font-scale, $infix-padding-top + $fill-appearance-label-offset,
$infix-margin-top);
Expand Down
5 changes: 2 additions & 3 deletions src/material/legacy-form-field/_form-field-legacy-theme.scss
Expand Up @@ -119,8 +119,7 @@ $legacy-dedupe: 0;

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

// Server-side rendered matInput with a label attribute but label not shown
// (used as a pure CSS stand-in for mat-form-field-should-float).
.mat-input-server[label]:not(:label-shown) + .mat-form-field-label-wrapper
.mat-input-server[label] + .mat-form-field-label-wrapper
.mat-form-field-label {
@include _label-floating-print(
$subscript-font-scale, $infix-padding, $infix-margin-top);
Expand Down
Expand Up @@ -127,8 +127,7 @@ $outline-dedupe: 0;

// Server-side rendered matInput with a label attribute but label not shown
// (used as a pure CSS stand-in for mat-form-field-should-float).
.mat-input-server[label]:not(:label-shown) + .mat-form-field-label-wrapper
.mat-form-field-label {
.mat-input-server[label] + .mat-form-field-label-wrapper .mat-form-field-label {
@include _label-floating(
$subscript-font-scale, $infix-padding + $outline-appearance-label-offset,
$infix-margin-top);
Expand Down
3 changes: 1 addition & 2 deletions src/material/legacy-form-field/_form-field-theme.scss
Expand Up @@ -206,8 +206,7 @@ $dedupe: 0;

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

0 comments on commit 86c4a9d

Please sign in to comment.