Despite my efforts to globally override the font, I am still encountering instances where the Roboto font is not being replaced, particularly on MUI select and autocomplete components.
import { createTheme } from '@material-ui/core/styles';
// A customized theme for this application
const theme = createTheme({
typography: {
fontFamily: [
'DM Sans',
'sans-serif',
].join(','),
},
components: {
MuiCssBaseline: {
styleOverrides: `
@font-face {
font-family: 'DM Sans', sans-serif;
font-style: normal;
font-display: swap;
font-weight: 400;
src: url(https://fonts.googleapis.com/css2?family=DM+Sans) format('woff2');
unicodeRange: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF;
}
`,
},
},
});
export default theme;