I encountered an issue while attempting to utilize an npm package containing a Typography element from Material UI. The code is authored by me. Upon integrating it into a project, I noticed that the typography's CSS class properties were overpowering my custom CSS properties. For instance, the margin property present in both the custom and "MuiTypography-h1" classes resulted in the latter taking precedence in certain scenarios. How can I tackle this problem?
My belief is that custom CSS properties should always override MUI default CSS class properties. Is there a way to achieve this? https://i.sstatic.net/Tbf4X.png
<Typography
variant="h1"
sx={{
width: '235px',
height: '96px',
fontSize: '20px',
fontWeight: 500,
lineHeight: '1.2',
color: 'primary',
textOverflow: 'ellipses',
overflow: 'hidden',
display: '-webkit-box',
WebkitLineClamp: 4,
WebkitBoxOrient: 'vertical',
marginTop: '11px',
}}
>
Title
</Typography>