【发布时间】:2020-07-18 10:42:34
【问题描述】:
是否可以转换 Material UI 元素
<Container component="main" maxWidth="XS">
<Typography component="h1" variant="h5">
Sign in
</Typography>
进入样式化组件?
我试过这个排版,但文字看起来要小得多。
export const Typo = styled.h5`
export const Typo = styled(Typography)`
component: h1;
variant: h5;
`
另一个例子:我尝试使用它,但mt: 8也不起作用。我也无法从 Material ui 系统导入 Box,所以在看到示例后尝试了此方法。
import Box from '@material-ui/core/Box';
export const StyledBox = styled(Box)`
mt: 8;
【问题讨论】:
标签: javascript reactjs typescript material-ui styled-components