const fontWeightMedium = 500;
const theme = createMuiTheme({
typography: {
// Use the system font.
fontFamily:
'forzaBook',
fontWeightMedium,
body1: {
fontWeight: fontWeightMedium,
},
button: {
fontStyle: 'italic',
},
caption: {
fontWeight:100
}
},
palette: {
primary: orange,
secondary: {
...grey,
// A400: '#00e677',
},
contrast: 'white',
error: red,
}
});
以下是我目前用于更改字体和某些“版式”属性的内容。但我需要更改标题的字体。有谁知道怎么做?
答案 0 :(得分:3)
您可以在每个Typography-variant基础上覆盖fontFamily:
const theme = createMuiTheme({
typography: {
fontFamily: 'forzaBook',
caption: {
fontFamily: "sans-serif"
}
},
});