-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
[Select][NativeSelect] Polish CSS classes #26186
Conversation
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.
Almost good to go from my end
overridesResolver: (props, styles) => { | ||
const { styleProps } = props; | ||
return { | ||
[`&.${selectClasses.select}`]: { |
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.
We could add a comment on why we bump the specificity, from what I remember, it's important to guarantee that the customization is applied. The base style comes from the InputBase-input which we have no injection order guarantee with.
Ah yes, we say "// Win specificity over the input base" below
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.
We need to keep the bump:
[`&.${selectClasses.select}`]: { | |
// Win specificity over the input base | |
'&': { |
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.
@m4theushw what do you think about this comment?
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.
Updated. Missed this one because there's already a comment below.
Breaking changes
[Select] The
selectMenu
slot was merged intoselect
becauseselectMenu
slot was redundant. Theroot
slot is no longer applied to the select, but to the root.[NativeSelect] The
selectMenu
slot was merged intoselect
becauseselectMenu
slot was redundant. Theroot
slot is no longer applied to the select, but to the root.[TablePagination] The
classes.input
key was changed to be applied on another element. Useclasses.select
instead.Part of #20012
Closes #11646
Closes #25313
I couldn't understand very well the discussion that lead to this change. I found #25766 (comment) about removing
root
andselect
. But the TODO in the code was to removeselectMenu
. If it was not the specificity bug raised in #25763, we would only need to keeproot
.