-
-
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
[Button] Add missing color type #26593
Conversation
@oliviertassinari @siriwatknp could you review the commit? Today is a weekend, so almost everyone is taking the time off. Please review when you get time. |
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.
This is a step in the direction I think we should go into 👍. However, I think that we could push it much further:
- We can extend most of the other component to allow all the default colors of the theme
- We can extract the colors from the theme. See [design-system] Support error|success|warning|info by default in color prop #24778 (comment) and this quick test (
PaletteColorKeys
contains neutral). It would simplify this part of the docs: https://next.material-ui.com/customization/palette/#adding-new-colors.
@oliviertassinari Bootstrap v4/5 supports Light/Dark/Link colors. Nice if Material-UI can match as many colors as Bootstrap to be feature color complete. What is your opinion of supporting more colors? https://getbootstrap.com/docs/4.6/components/buttons/#examples |
@sakura90 Off-topic to these changes. Here, I think that we should focus on the support the existing ones of the theme in components 1. , with a possible extension to 2. if it's not too complex/or make 1. easier. But to answer, this is up to @danilo-leal. |
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.
Looks good to me 👍
Have some private things to do, so I am going to be unavailable for atleast about a week. Please feel free to continue the work. The next change is going to address the above step. I am going to continue working on the above step when I am back if nobody works on it. |
I think we should merge this since it is a bug fix for Button (so it does not block beta) and open another PR to work on the color design-system. |
@siriwatknp I would personally not frame the current behavior as a bug as we have been pushing against it in v4 to restrict the number of colors to make it consistent with the other components and do not have the JSS class name grow significantly. Happy to move with a smaller step, and merge. We know we want to support all the theme.palette colors in all the components. It will require a lot more effort but it's a step forward. |
I consider it as typescript bug because // @ts-expect-error
<Button color="success" /> the button is green. What if we merge this and I will open another PR to list all the components that need to be updated and other people can help? Anyway, feel free to change the title and label back. I think this is one step toward #24778. |
@siriwatknp Interesting, to the limit where we don't document it.
Is #24778 enough to provide more guidance for the community? |
Yep, I think it is enough. |
I have followed (at least) the PR section of the contributing guide.
Coded the change that @oliviertassinari aimed for (24778#issuecomment)
Modified the documentation for Button color from ['inherit', 'primary', 'secondary'] to ['inherit', 'primary', 'secondary', 'default', 'success', 'error', 'info', 'warning']
One step toward #24778.