I want to override the defaults and apply a font size and family (without using inline) to a list element in a drawer. I don't want to create a new theme. I use the "useStyles" function to do that for other properties, but for some reason it doesn't work for them. If I disable them in the browser dev tools my changes take effect - any idea of how to do that in the code?
There is another similar thread but the explanation unfortunately doesn't help me:overwrite the font size of this class .MuiTypography-body1
const useStyles = makeStyles(theme => ({
root: {
display: "flex"
},
listItems: {
margin: "7vh 0 7vh 0"
},
listText: {
padding: "1vh 0 1vh 0",
textAlign: "center",
fontSize: "50px",
fontFamily: "typeface-pacifico"
}
}));
You have to create a MuiTheme in order to override body1.
Below is the code you will need.
Then have a ThemeProvider component wrap your content like below,