I have material-ui@next installed and i want to customized the background color of the theme.
I tried this:
const theme = createMuiTheme({
palette: createPalette({
type: 'light',
primary: purple,
background: {
default: '#303030',
},
}),
});
And this.
<MuiThemeProvider theme={theme}>
But the background color is still white when it should change to red.
I also faced this issue. To fix this, import CssBaseline:
import CssBaseline from "@material-ui/core/CssBaseline";
Then add it like this:
<MuiThemeProvider theme={theme}>
<CssBaseline />
Using CssBaseline while setting background color as follows the color gets applied:
import { createMuiTheme } from "@material-ui/core/styles";
const theme = createMuiTheme({
palette: {
background: {
default: "#303030"
}
}
});
You can find a working snippet here.