-
-
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
[ToggleButton] Add color palette types #27046
[ToggleButton] Add color palette types #27046
Conversation
@siriwatknp had a list of which components should support these colors, he could provide more information/guidance |
@ShirasawaSama the details is in this PR #26697. We tried to add color type for the components that make sense. I am happy to learn about your use case, could you share how your use case on the ToggleButton? (screenshot is fine). If there is no objection for the ToggleButton to support color palette, we can move forward with adding it. |
This may be against the design rules of material design. I have another question. Why do some components have different default color values, such as:
This makes me confused. |
Seems like you change the wrong component, should it be |
@siriwatknp Maybe I should change the tag in the title to |
@ShirasawaSama can you revert the code for by the way, from your use case, do you need |
8ebef06
to
b7486ed
Compare
@ShirasawaSama my apology. From your explanation, I will merge only ToggleButton color palette. If you have a use case for ButtonGroup, feel free to open another PR. |
@@ -51,7 +51,7 @@ const useUtilityClasses = (styleProps) => { | |||
`grouped${capitalize(orientation)}`, | |||
`grouped${capitalize(variant)}`, | |||
`grouped${capitalize(variant)}${capitalize(orientation)}`, | |||
color !== 'default' && `grouped${capitalize(variant)}${capitalize(color)}`, | |||
`grouped${capitalize(variant)}${capitalize(color)}`, |
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.
color will never be "default", the change is better.
In
5.0.0-alpha.38
, if I use<ToggleButtonGroup color='error' />
, it will report:But it still works.
Preview: https://deploy-preview-27046--material-ui.netlify.app/api/toggle-button/#props