I am interested in learning how to incorporate a new font weight into my theme, for example, fontWeightSemiBold
, and disable the existing fontWeightLight
and fontWeightMedium
. I believe this can be achieved through module augmentation. For reference, there is an example of customizing Typography's variants available here. Ideally, I would like to specify this in my theme configuration.
export const theme = createTheme({
typography: {
fontWeightSemiBold: 600,
},
});
Furthermore, I want to use this new font weight in JSX without encountering any issues with TypeScript.
<Typography sx={{ fontWeight: 'fontWeightSemiBold' }}>Hello</Typography>