I'm working on a Material-UI based project and trying to add some self-hosted fonts, since they're not available as google fonts. I've followed both the Material-UI and JSS docs, and I've come up with the following, but I can't find the reason why it's still not working. There are no errors either to give me a clue as to what's wrong.
import { createMuiTheme } from "@material-ui/core/styles";
import Windlass from "./fonts/Windlass.eot";
import Windlass2 from "./fonts/Windlass.woff";
const theme = createMuiTheme({
...
typography: {
useNextVariants: true,
fontFamily: [
'Windlass',
'Helvetica Neue',
'Helvetica'
].join(','),
fontSize: 16,
fontWeightLight: 400,
fontWeightRegular: 400,
fontWeightMedium: 600,
fontWeightBold: 700},
overrides: {
MuiCssBaseline: {
'@global': {
'@font-face': {
fontFamily: 'Windlass',
src: `url(${Windlass})`,
fallbacks: [
{src: `url(${Windlass}?#iefix) format(embedded-opentype)`},
{src: `url(${Windlass2}) format(woff)`}
]
}
}
}
}
});
export default theme;
The font name does seem to show up in the css when I inspect the element as
font-family: Windlass,Helvetica Neue,Helvetica;
but the text shows up as Helvetica Neue.