Can we add new property for color in palette in MuiTheme
See original GitHub issueLike MuiTheme already provided a way to override colors of 3 property
-
Primary
-
Secondary
-
error
This is the below way to change the colors of existing properties.
palette: {
primary: {
main: palette.primary[500],
},
secondary: {
main: palette.secondary.A400,
},
error: {
main: palette.error[500],
},
},
What If we need to define new property for color like
palette: {
primary: {
main: palette.primary[500],
},
secondary: {
main: palette.secondary.A400,
},
error: {
main: palette.error[500],
},
> success : {
> main : "#bac778"
> }
},
Is that possible ?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:38
- Comments:15 (10 by maintainers)
Top Results From Across the Web
Can we add new property for color in palette in MuiTheme
No, you can't use the success color property directly. You need to create a wrapping component to use the theme values.
Read more >How to add custom MUI palette colors - Stack Overflow
The MUI palette is extendable, but you need to do a couple of things to create a new color and apply to your...
Read more >MUI Custom Colors: How to Customize Colors and Themes in ...
In this tutorial, we will learn how to customize colors in Material UI by creating a new theme and adding a set of...
Read more >Palette - Material UI - MUI
Adding new colors. You can add new colors inside and outside the palette of the theme as follows:.
Read more >Customizing the Material-UI Theme Color Palette (MUI v5)
This demo shows how to override palette colors, add new categories to the palette, and create a component that uses the custom colors....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@davidcalhoun Yes, you are right, this issue is about extending the Button implementation so people can just do:
then have a working:
implementation.
The best solution right now is to add the color in the theme, then to create a wrapping component:
https://codesandbox.io/s/7zmw6ox8m1
By the way, we are planing on extending the color to
primary | secondary | success | warning | error/danger? | info
. Would that help in your case?Yes I can but I cannot use it like
<Button color="success">Login</Button>
It gives warning about to use only primary default secondary