【问题标题】:how to access theme toolbar breakpoint properties?如何访问主题工具栏断点属性?
【发布时间】:2020-11-10 05:29:40
【问题描述】:

我正在使用 material-ui themeProvider 并尝试从样式中的默认主题访问所有高度值:

makeStyles(theme => createStyles({
 ...
 marginTop: -theme.mixins.toolbar.minHeight, // works
 [`${theme.breakpoints.up('xs')} and (orientation: landscape)`]: {
   marginTop: -theme.mixins.toolbar.@media___????.minHeight },
  [theme.breakpoints.up('sm')]: { 
    marginTop: -theme.mixins.toolbar.@media___????.minHeight },

如何访问@media 值?

【问题讨论】:

    标签: material-ui jss


    【解决方案1】:

    与使用括号表示法访问对象属性相同

    theme.mixins.toolbar['@media (min-width:0px) and (orientation: landscape)'].minHeight

    【讨论】:

      猜你喜欢
      • 2016-06-09
      • 2012-03-20
      • 2018-09-24
      • 1970-01-01
      • 2015-07-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多