我正在考虑按照以下方式进行操作,但是我不确定是否建议这样做:
import * as React from "react"
import { withStyles, createStyles, Theme } from "@material-ui/core"
import CssBaseline from "@material-ui/core/CssBaseline"
// global styles for a Mapper app
class MyCssBaseline extends React.Component {
render() {
return <CssBaseline />
}
}
export default withStyles(styles)(MapperCssBaseline)
function styles(_theme: Theme) {
return createStyles({
"@global": {
fontSize: 12,
// ... custom styles here ...
}
})
}
这是怎么回事?还是有更推荐的方法?
答案 0 :(得分:0)
创建主题时,我设法用overrides
做到了
export const theme: Theme = createMuiTheme({
overrides: {
MuiCssBaseline: {
'@global': {
svg: {
maxWidth: '100%',
maxHeight: '100%',
},
},
},
},
})