-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
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] Expose the theme.palette.augmentColor function #10499
Comments
You can add custom keys to the theme,
|
@MichaelMure Does @mbrookes comment answer your problem?
From our experience with the core components, we couldn't find an approach that scale. I believe this is "code" you have in userland. You are free to inject the value into the theme so you don't repeat it.
Are you saying you want to have access to the |
Not really. I know ( = found out after testing, maybe it should be mentioned explicitly ?) that it's possible to augment manually the palette. But as someone with limited color picking ability, I have no idea what to actually use. My point is that even after reading the different documentation, you don't get much idea about how to handle background colors. In fact, because background colors are not mentioned, I thought in the beginning that the primary color was the background color. Obviously it didn't end well. I think that providing a 'not bad' default set of background colors will help new users and guide them for when they want to use better values. As I said in the original comment, there is various way to achieve that.
Yes, and That said, I think having just another internal call to |
https://material-ui.com/customization/themes/#custom-variables
I can see merit in
|
Indeed... |
@MichaelMure Thanks for the feedback. So, I believe we can move forward with the issue by exposing the |
Hi, I have a PR for this: #10985, it's useful for me. |
Random idea from a user:
material-ui removed recently the
palette.palette.background.*
colors. Maybe I got it wrong, but I find these colors quite useful when creating panels and stuff for an app, having a selection of colors I can pick from.I would be nice to have material-ui generate a decent selection of colors, based on the type of palette (light or dark). This could be done different ways:
palette.primary
andpalette.secondary
, havepalette.background
behave the same way. Whenpalette.background.primary
is set, computedark
,light
andcontrastText
colors. For example, providinggrey[800]
would generate decent dark background shades,grey[300]
would generate light background shades.dark
,light
andcontrastText
so users are free to setup background values easily instead of harcoding colors.In particular, this would avoid doing things like
theme.palette.grey[theme.palette.type === 'light' ? 300 : 900]
in each components.The text was updated successfully, but these errors were encountered: