For example I am trying to style ListItem
I can find a lot of example using the sx (all use Box as example )
but when I try something like below, it does not work
<ListItem button onClick={handleClick}
sx={{
root: {
//
}
}}
>
Thank you.
Update
This attempt also does not work
classes reference:https://github.com/mui-org/material-ui/blob/v4.9.12/packages/material-ui/src/ListItem/ListItem.js#L29
const MyListItem = styled(ListItem)({
root: {
width: "10%",
},
button: {
"&:hover": {
textDecoration: "none",
backgroundColor: "blue",
"@media (hover: none)": {
backgroundColor: "transparent",
},
},
},
});
<MyListItem button onClick={handleClick}>
//content
</MyListItem>