【问题标题】:Targeting multiple elements with JSS使用 JSS 定位多个元素
【发布时间】:2020-06-28 20:20:36
【问题描述】:

我正在尝试针对排版 mui 类的所有 h 元素。一个一个地写很烦人:

        typography: {
    "& h1": {
      fontWeight: "400",
    },
    "& h2": {
      fontWeight: "400",
    },
    "& h3": {
      fontWeight: "400",
    },
    "& h4": {
      fontWeight: "400",
    },
    "& h5": {
      fontWeight: "400",
    },
    "& h6": {
      fontWeight: "400",
    },
}

应该有更短的语法吗?

【问题讨论】:

    标签: material-ui jss


    【解决方案1】:
      tyopgraphy: {
        '& h1, & h2, & h3, & h4, & h5, & h6': {
          fontWeight: '400',
        },
      },
    

    【讨论】:

      猜你喜欢
      • 2018-12-09
      • 1970-01-01
      • 2012-05-12
      • 2011-12-04
      • 1970-01-01
      • 2019-05-10
      • 1970-01-01
      • 1970-01-01
      • 2021-12-21
      相关资源
      最近更新 更多