Looking to bring in a fresh font family stored in a fonts directory and replace the existing mui base font family.
import { responsiveFontSizes, createTheme } from '@mui/material';
import NEWFONTFAMILLY from '../fonts/something.otf'
const theme = responsiveFontSizes(
createTheme({
components: {
MuiCssBaseline: {
styleOverrides: {
fontFamily: [NEWFONTFAMILLY],
},
},
},
})
);
export default theme;
After using this code, I noticed that the mui font family is being applied instead of my custom one:
@font-face {
font-family: 'NEWFONTFAMILLY';
src: url(../fonts/something.otf) format('opentype');
}
* {
font-family: 'NEWFONTFAMILLY';
}
Can anyone assist me with this issue?
I am working with @mui/material v5+