如何使用辅助调色板颜色更改对话框内文本字段的下划线颜色?我无法做到这一点,因为文档非常混乱
假设您使用的是material-ui-next,您可以使用覆盖 in 创建Mui主题.
import { MuiThemeProvider, createMuiTheme } from 'material-ui/styles';
const theme = createMuiTheme({
overrides: {
MuiInput: {
underline: {
'&:before': { //underline color when textfield is inactive
backgroundColor: 'red',
},
'&:hover:not($disabled):before': { //underline color when hovered
backgroundColor: 'green',
},
}
}
}
});
然后用以下内容包装您的应用程序Mui主题提供者
ReactDOM.render(
<MuiThemeProvider theme={theme}>
<Root />
</MuiThemeProvider>,
document.getElementById('root')
);
它将覆盖所有 TextField Material-ui 组件的下划线颜色。如果您只需要更改一个 TextField 的颜色,请使用https://material-ui-next.com/customization/overrides/#1-special-variation-for-a-one-time-situation https://material-ui-next.com/customization/overrides/#1-specific-variation-for-a-one-time-situation
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)