I would like to import a new font family in a fonts folder and override the 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;
If I use these code the mui font famiy is applied and not mine :
@font-face {
font-family: 'NEWFONTFAMILLY';
src: url(../fonts/something.otf) format('opentype');
}
* {
font-family: 'NEWFONTFAMILLY';
}
Can someone plese help me ?
I am using @mui/material v5+