I am trying to look for documentation or code example how can I specify addition colors in Material UI theme.
Right now I have following theme configuration
const theme = createMuiTheme({
palette: {
primary: {
main: "#B31728"
},
secondary: {
main: "#202833"
}
},
...
Now I have a case where I want to use a color for successful operations such as
import { green } from "@material-ui/core/colors";
<Fragment>
{isVerified ? (
<VerifiedUser style={{ color: green[500] }} />
) : (
<Error color="primary" />
)}
</Fragment>
I want to set the color of VerifiedUser Icon in the same way it is set for Error Icon. But the theme palette configuration only has primary and secondary intentions. How can I set a color lets say "success" so that I can be able to pass it like
<VerifiedUser color="success" />
palette
. Handling this ascolor
property on you components would require you to implement this yourself and the material-ui components wouldn't know of this custom colors. – Jan P