我正在尝试在 Next.js 中使用 Material-UI 时向我的 theme.js 添加不同的字体。很难弄清楚如何做到这一点。
我已经尝试按照此处的建议(https://github.com/zeit/next.js/issues/512)使用 fontfaceobserver ,但无法更新主题。这是我的 theme.js 文件:
const theme = createMuiTheme({
typography: {
fontFamily: [
'Raleway','Roboto Condensed',
].join(','),
fontWeight: 700,
h1:{
fontFamily: 'Raleway',
fontWeight: 700,
}
},
});
Run Code Online (Sandbox Code Playgroud)
我的 h1 的字体没有改变:(