Material-ui: Custom primary color.

Created on 13 Jan 2018  路  3Comments  路  Source: mui-org/material-ui

Library doesn't provide API for setting custom primary colors.

const muiTheme = createMuiTheme({
  palette: {
    primary: '#337ab7', // custom color in hex
    error: red
  }
});
question

Most helpful comment

It does:

const muiTheme = createMuiTheme({
  palette: {
    primary: { 500: '#337ab7' }, // custom color in hex
  error: red
}
});

And is well documented: https://material-ui-next.com/customization/themes/#palette

And now we've made it even easier: #9794

Please use gitter or StackOverflow to ask questions, and if submitting a confirmed issue, please fill out the issue template provided.

All 3 comments

It does:

const muiTheme = createMuiTheme({
  palette: {
    primary: { 500: '#337ab7' }, // custom color in hex
  error: red
}
});

And is well documented: https://material-ui-next.com/customization/themes/#palette

And now we've made it even easier: #9794

Please use gitter or StackOverflow to ask questions, and if submitting a confirmed issue, please fill out the issue template provided.

{ 500: '#337ab7' } so obvious
and i still have a problem
image
image

@miukki Youe error color is a digit short...

-  error: { main: '#ff000'},
+  error: { main: '#ff0000'},
Was this page helpful?
0 / 5 - 0 ratings