Ben*_*der 1 javascript fonts reactjs material-ui
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,
}
});
Run Code Online (Sandbox Code Playgroud)
这是我目前用于更改字体和一些版式属性的内容。但我需要更改标题的字体。有谁知道如何做到这一点?
您可以在每个 Typography-variant 基础上覆盖 fontFamily:
const theme = createMuiTheme({
typography: {
fontFamily: 'forzaBook', // Change the default
caption: {
fontFamily: "openSans" // Change a specific variant
}
},
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2175 次 |
| 最近记录: |