【问题标题】:Make material-ui v1 Button white by default将material-ui v1 Button默认设为白色
【发布时间】:2017-09-23 16:55:17
【问题描述】:

material-uiRaisedButton 过去是 white by default,如果不是 primarysecondary。他们现在已将其更改为grey by default

我想知道默认情况下将所有这些按钮设为白色的最干净的方法是什么?

我想我可以简单地添加一些内联样式或类并编写 CSS 来完成它,但是没有办法使用官方自定义 API 来完成它吗?

【问题讨论】:

    标签: javascript css material-ui


    【解决方案1】:

    这是最简洁的方法,确实使用了覆盖对象,正如 dan 所提到的:

    const myTheme = createMuiTheme({
      // other theme stuff
      overrides: {
        MuiButton: {
          raised: {
            backgroundColor: 'white',
          },
        },
      },
    });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-12-07
      • 2020-08-08
      • 1970-01-01
      • 2017-04-21
      • 2021-06-02
      • 1970-01-01
      • 2018-12-15
      相关资源
      最近更新 更多