-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
[TimePicker] Add Mui-selected
class to TimeClock
meridiem buttons
#13848
[TimePicker] Add Mui-selected
class to TimeClock
meridiem buttons
#13848
Conversation
paddingLeft: 4, | ||
paddingRight: 4, | ||
width: CLOCK_HOUR_WIDTH, | ||
[`&.${clockClasses.selected}`]: { |
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.
Does this introduce any specificity change?
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.
Great point.
This could be a BC for someone currently overriding selected styles via theme.
I'll check.
As for the class specificity, I don't think we can run into it, because there was no way to identify the selected button based on DOM/Classes for now. 🙈
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.
If people are using the variants / the ownerState
in their theme, would they see their CSS change because of specificity change on our side?
I think so but I'm not very good at CSS specificity 😆
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.
@flaviendelangle
I've double-checked and indeed, we can't go this route, at least now, because for someone it would be a BC. 🙈
The following styles would no longer apply to a selected meridiem button:
MuiClock: {
styleOverrides: {
amButton: {
color: 'red',
},
pmButton: {
color: 'green',
},
},
},
Thus, I've reverted the change. 😉
Deploy preview: https://deploy-preview-13848--material-ui-x.netlify.app/ |
Fixes #12493.
Additional changes:
Refactor active/selected styles to depend on the. Can't do it now, because it's a possible BC: [TimePicker] AddMui-selected
class rather than using avariant
Mui-selected
class toTimeClock
meridiem buttons #13848 (comment)P.S. I picked this up after I saw an old stash with partially complete work. 🙈