-
-
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
[theme] Add warning, success and info colors to the palette #18820
[theme] Add warning, success and info colors to the palette #18820
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.
It's a good opportunity to improve our documentation for the colors :)
Wondering if/how this related to issues/prs like #17475 - won't the support of more colors in palette raise a lot of questions like why does component x only support primary and secondary but not...? |
@sakulstra agree, the goal would be to support them all with dynamic styles. |
…nal-colors-to-palette
I have attempted to refactor the unit tests in |
I also added documentation for the extra colors. I have edited sections |
While investigating the failing builds, I came across these lines in `/docs/src/pages/premium-themes/onepirate/modules/theme.js: const rawTheme = createMuiTheme({
palette: {
primary: {
...
},
...
success: {
xLight: green[50],
dark: green[700],
},
} This throws an error, as no |
I think we should go with the first approach. Accepting colors without main will break components that depend on it, and augmenting the palette color to calculate main from light or dark will add further complexity. |
@r3dm1ke I have tried a different set of colors, let me know what you think about it :). |
@material-ui/core: parsed: +0.12% , gzip: +0.19% Details of bundle changes.Comparing: 0b2196c...727efb4
|
f848247
to
3f93d60
Compare
3f93d60
to
9139a0d
Compare
I have done a second batch of ambitious changes. I think that it's good enough now, but it's only my perspective, happy to keep iterating. |
I love the new colors! I do not see anything else that can be improved in this particular PR, I think it is ready to be merged |
Co-Authored-By: Matt <[email protected]>
Co-Authored-By: Matt <[email protected]>
Co-Authored-By: Matt <[email protected]>
Well done :) |
Amazing job. Just in time for the holidays! Thank you! |
We might have introduced a breaking change for people that already have a success color in the palette as reported in hupe1980/gatsby-theme-material-ui#14. We will see how this problem evolves. |
It seems as though the new color intentions aren't supported yet by most of the APIs that have a At least looking in the documentation, these components still only accept |
Just noticed #18966. I think that's related, but I would expect that even if the prop types fail, the color would still be applied and a props error would just be thrown? I'm not seeing any color changes at all. |
@calvinl One step at the time :) |
@oliviertassinari apologies, I got a little excited :) |
Preview: https://deploy-preview-18820--material-ui.netlify.com/customization/palette/#palette.
Related to #13875 . I have set up the basics for the new colors in the palette, but I have a few questions:
packages/material-ui/src/styles/createPalette.test.js:681:14
is failing, though it does not look like I changed anything related to it.Also, I am not a designer 😅, thus the colors way not be as suitable, feel free to suggest new ones.