【发布时间】:2022-07-20 05:23:15
【问题描述】:
我想在字体文件夹中导入新字体系列并覆盖 mui 基本字体系列。
import { responsiveFontSizes, createTheme } from '@mui/material';
import NEWFONTFAMILLY from '../fonts/something.otf'
const theme = responsiveFontSizes(
createTheme({
components: {
MuiCssBaseline: {
styleOverrides: {
fontFamily: [NEWFONTFAMILLY],
},
},
},
})
);
export default theme;
如果我使用这些代码,则应用 mui 字体系列而不是我的:
@font-face {
font-family: 'NEWFONTFAMILLY';
src: url(../fonts/something.otf) format('opentype');
}
* {
font-family: 'NEWFONTFAMILLY';
}
有人可以帮帮我吗?
我正在使用@mui/material v5+
【问题讨论】:
标签: css fonts material-ui font-family