I'm using MuiThemeProvider in my component and I wanted to style the MenuItem from MUI. What I did here is creating a variable with createMuiTheme
like this
const themes = createMuiTheme({
overrides: {
MuiListItem: {
root: {
"&$selected": {
background: '#459FB6',
color: '#fff',
}
}
}
}
});
and I passed this to my ThemeProvider like this
<MuiThemeProvider theme={themes}>
<MenuItem>
Menu Item
</MenuItem>
</MuiThemeProvider>
I also have an object with a color palette and I want to use them inside my themes
. My question is how to achieve something like this
const themes = createMuiTheme({
overrides: {
MuiListItem: {
root: {
"&$selected": {
background: colors.blue, // here i want to use my custom variable
color: colors.white, // here i want to use my custom variable
}
}
}
}
});
Thanks in advance!