I am currently working on customizing a component using the sx MUI prop.
<Typography
variant='h1'
align='center'
sx={{ fontSize: '24px', pb: '8px', fontWeight: '700' }}
>
Admin Panel
</Typography>
The issue I am facing is that classes from the MUI theme have higher CSS specificity, causing them to override those set in the sx prop.
Below is the configuration of the MUI theme for typography:
typography: {
h1: {
fontSize: '2rem',
'@media screen and (min-width: 768px)': {
fontSize: '3rem',
},
'@media screen and (min-width: 1024px)': {
fontSize: '3.5rem',
},
},
},
You can also view how it appears in the developer tools by clicking the following link: https://i.sstatic.net/yBhkn.png
Is this behavior expected? Is there a workaround I can implement to resolve this issue?