Make theme.palette.augmentColor() pure
See original GitHub issueWe love the theme object, but starting to see how it could be extended.
• In most cases, a primary, secondary, error and grey color palette will support most applications. • I am having to add custom colors to the theme to cover a warning situation.
Rather than extend the theme to custom code new palettes, why not use the power of this theme to handle warning color just like error?
"warning": {
"light": "#",
"main": "#",
"dark": "#",
"contrastText": "#fff"
}
Also, I would like to see warning and error as color props for the Button component:
<Button color='primary' variant='raised'>Text</Button>
<Button color='secondary' variant='raised'>Text</Button>
<Button color='error' variant='raised'>Text</Button>
<Button color='warning' variant='raised'>Text</Button>
This will greatly reduce the amount of code developers are having to write for more use cases for buttons, and use the power of the theme to consistently style applications.
Great work!!
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:12 (10 by maintainers)
Top Results From Across the Web
Make theme.palette.augmentColor() pure #12390 - GitHub
In most cases, a primary, secondary, error and grey color palette will support most applications. • I am having to add custom colors...
Read more >Palette - Material UI - MUI
The palette enables you to modify the color of the components to suit your brand. Palette colors. The theme exposes the following palette...
Read more >How can I extend Color Palette in Material UI with Typescript
I am trying to extend the color palette on a global theme. in my themeConitainer.tsx import { ThemeOptions } from '@material-ui/core/styles/ ...
Read more >v4.0.0-alpha.0 - material-ui changelog
The theme.palette.augmentColor() method no longer performs a side effect on its input color. In order to use it correctly, you have to use...
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 FreeTop 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
Top GitHub Comments
Here it is: https://github.com/mui-org/material-ui/pull/13376
@jacobweber I’m not sure it will be possible, the
augmentColor
function relies on two theme variables you can provide as options: