【问题标题】:Change hover color of <TextField /> in createMuiTheme()在 createMuiTheme() 中更改 <TextField /> 的悬停颜色
【发布时间】:2019-11-30 07:47:42
【问题描述】:

如何更改createMuiTheme() 中概述 &lt;TextField /&gt; 组件的hover 上的borderColor?为带下划线的&lt;Input /&gt; 做这件事相当容易

export default createMuiTheme({   
    MuiInput: {
        '&:hover:not($disabled):not($focused):not($error):before': {
            borderBottom: '2px solid red',
        },
    }
});

但是我如何访问 outlined &lt;TextField /&gt; 组件 (variant='outlined')。

一般来说:我真的很怀念传递给JSON 的props 的一个很好的文档@ 987654331@... 有没有一个地方我可以看到整个对象,以及所有可能/可用的道具?!

【问题讨论】:

    标签: javascript reactjs material-design material-ui


    【解决方案1】:

    谁遇到这个:我查看了 Material UI 的 Github 存储库,在这个文件的第 12-35 行。

    https://github.com/mui-org/material-ui/blob/master/packages/material-ui/src/OutlinedInput/OutlinedInput.js

    然后我把它改成了

    export default createMuiTheme({
        overrides: {
            MuiOutlinedInput: {
                root: {
                    '&:hover:not($disabled):not($focused):not($error) $notchedOutline': {
                    borderColor: 'red',
                },
            },
          }
        }
    });
    

    【讨论】:

      猜你喜欢
      • 2021-06-29
      • 1970-01-01
      • 1970-01-01
      • 2015-10-19
      • 1970-01-01
      • 2018-01-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多