-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
[Checkbox, Radio, Switch] Change default color, add color prop #10138
[Checkbox, Radio, Switch] Change default color, add color prop #10138
Conversation
@mbrookes What about applying #9742 (comment) here and everywhere else?
|
Sure, I'll do it here. Doing it everywhere else is for another PR! 😰 |
@mbrookes Yes, it's! What's important is to decide on the CSS specificity approach. |
@oliviertassinari Done. |
This is a pilot toward solving #10010 and #9742 at scale. It's inspired by the Bootstrap approach to write CSS. Basically, it's following two rules:
const styles = {
root: {
color: green[600],
'&$checked': {
color: green[500],
},
},
checked: {},
}; |
@oliviertassinari It doesn't look like you started with the latest version of this PR, as we have lost some of the docs changes. I can force push to my branch so you can rebase your commit. |
Alternatively we can omit the specificity change in my last commit (leaving the docs changes), merge this PR, and you can submit a separate PR for the specificity pilot. (What we should probably have done in the first place.) |
@mbrookes I'm sorry If I have lost some changes you did. Yes, please submit them back :).
So the plan is to limit the scope of this pull-request to the selection control color breaking change and I will push the specificity change in another pull-request targeting the tabs and the selection control components? (I don't want to touch the button before @nathanmarks effort on this component) |
Okay, I've removed the specificity change from the last commit & force pushed. I know you had added an unlabelled Checkboxes example in one of your commits, but I'd had the opposite thought, as the unlabelled radios & switches don't really make much sense. I"m not sure what the anticipated use case might be; in a table perhaps? If so, that's probably what the demo should show. As for the unlabelled switches example, that contradicts the text before it: "The option that the switch controls, as well as the state it’s in, should be made clear from the corresponding inline label." |
@mbrookes No it doesn't. But I think it's too much assumption that people are going to use our label helper. For instance, Open Collective isn't. Better showing them the simplest example possible first (unlabeled). |
In that case the ordering of the examples as it is for Radio makes most sense, with the unlabelled selection control being a minimal example. I'd still prefer to see them in the context of a use-case, but it isn't a priority. |
@mbrookes Just curious, but if the spec says to use the |
@gabrielliwerant The diff shows the upgrade path to keep the previous behavior. But if you are happy with the change. No need to do anything. |
Closes #4706
Breaking change
The Material Design specification says that selection controls elements should use the application's secondary color.