Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/material/form-field/_form-field-fill-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +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-input-server[label]:not(:placeholder-shown) + .mat-form-field-label-wrapper
Copy link
Member

Choose a reason for hiding this comment

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

I think we should remove all the :not(:placeholder-shown) usages altogether. The recommended approach for labelling inputs has been using mat-label for a long time now.

Copy link
Author

Choose a reason for hiding this comment

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

Shall we just remove all these rules then? I guess they should not work anyway (see my tiny copen)

Nevertheless, couldn't we just fix the obvious bug(reverting the pseudo-selector) and handle any further optimizations afterwards?

Copy link
Member

Choose a reason for hiding this comment

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

I would rather keep the selectors without the :not. It's possible that this was a regression the entire time, but we never noticed it.

.mat-form-field-label {
@include _label-floating(
$subscript-font-scale, $infix-padding-top + $fill-appearance-label-offset,
Expand Down
4 changes: 2 additions & 2 deletions src/material/form-field/_form-field-legacy-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +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-input-server[label]:not(:placeholder-shown) + .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 +165,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]:not(:placeholder-shown) + .mat-form-field-label-wrapper
.mat-form-field-label {
@include _label-floating-print(
$subscript-font-scale, $infix-padding, $infix-margin-top);
Expand Down
2 changes: 1 addition & 1 deletion src/material/form-field/_form-field-outline-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +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-input-server[label]:not(:placeholder-shown) + .mat-form-field-label-wrapper
.mat-form-field-label {
@include _label-floating(
$subscript-font-scale, $infix-padding + $outline-appearance-label-offset,
Expand Down
2 changes: 1 addition & 1 deletion src/material/form-field/_form-field-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +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-input-server[label]:not(:placeholder-shown) + .mat-form-field-label-wrapper
.mat-form-field-label {
@include _label-floating(
$subscript-font-scale, $infix-padding, $infix-margin-top);
Expand Down