-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(material-experimental/mdc-form-field): add workaround for incorrect MDC label size #23137
Conversation
…ct MDC label size
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
// We have to target the inner <mat-label> rather than the <label> because MDC applies | ||
// high-specificity rules that incorrectly hard-code the size as 1rem on the label. | ||
.mat-mdc-form-field mat-label, | ||
.mat-mdc-form-field mat-label::after, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be .mdc-floating-label::after
? The asterisk is a pseudo-element of the parent element, not mat-label
, or is that targeting something else?
@mmalerba This would be fixed by #23005 too. Your approach seems easier to maintain, but unfortunately breaks in pre-rendering where the non-upgraded notched-outline has some special styling to make the label appear as it would in the hydrated component. e.g. this is how it looks now pre-rendered: With #23005 it will pre-rendered correctly too (although it being a bit more code to maintain; but worth it IMO; especially since MDC puts effort into pre-rendering visuals) (I'm just removing merge ready; so that we can chat about it) |
@devversion I do think we should make your change, though I'm not sure if it will be sufficient to overpower the specificity of some of the styles MDC sets. I'll put mine on pause until yours goes in, then we can verify and see if any additional changes need to happen to workaround. |
@mmalerba Sounds good 👍 I've rebased the other PR; should be good to go. |
Closing since #23005 solved this issue |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
No description provided.