Within the project, I am utilizing this theme:
export const theme = createMuiTheme({
...defaultThemeConfig,
overrides: {
...defaultThemeConfig.overrides,
MuiListItem: {
root: {
'&:nth-child(odd)': {
backgroundColor: colors.greyLight,
},
},
},
},
});
I aim to override it in my styles.ts file as follows:
export const useStyles = makeStyles(({ spacing, breakpoints, palette, zIndex }: Theme) => ({
MuiListItem: {
root: {
'&:nth-child(odd)': {
backgroundColor: 'none',
},
},
},
}));
I have also attempted these approaches:
'& MuiListItem': {
root: {
'&:nth-child(odd)': {
backgroundColor: 'none',
},
},
},
And these variations as well:
'.MuiListItem-root': {
'&:nth-child(odd)': {
backgroundColor: 'red',
},
},
'& .MuiListItem-root': {
'&:nth-child(odd)': {
backgroundColor: 'red',
},
},
'&.MuiListItem-root': {
'&:nth-child(odd)': {
backgroundColor: 'red',
},
},
Despite trying multiple methods, none seem to be working. Any insights on where I might be going wrong?