【发布时间】:2019-02-08 13:12:25
【问题描述】:
希望能够在 Material UI 中为平板电脑的样式对象设置纵向和横向视图
const styles = theme => ({
root: {
padding: theme.spacing.unit,
[theme.breakpoints.up('md')]: {
backgroundColor: theme.palette.secondary.main
}
}
}
如何为纵向视图和横向视图添加断点,类似于传统的媒体查询:
@media screen and (orientation: landscape) {
body {
flex-direction: row;
}
}
@media screen and (orientation: portrait) {
body {
flex-direction: column;
}
}
【问题讨论】:
-
你遇到了什么问题?
标签: javascript reactjs material-ui responsive