I have the following CSS:
@media screen and (min-width: 0px) and (max-width: 400px) {
body { background-color: red; }
}
@media screen and (min-width: 401px) and (max-width: 599px) {
body { background-color: blue; }
}
@media screen and (min-width: 600px) {
body { background-color: green; }
}
And I have the following Material UI theme:
export const theme = createMuiTheme({
palette: {
background: {
default: 'red'
},
}
});
I would like to replace the hard-coded CSS with breakpoints in the Material UI theme but I can't figure out how to do it. I've tried the following (and several variations) and nothing seems to work.
const defaultTheme = createMuiTheme();
export const theme = createMuiTheme({
palette: {
background: {
[defaultTheme.breakpoints.down('sm')]: {
default: 'red'
}
},
}
});
Is this not supported by Material UI?