material-ui - Material-UI TextField:控制边框颜色
问题描述
强调文本如何控制 MUI TextField 的边框颜色?
<DarkTextField
variant="outlined"
margin="dense"
inputRef={input => (this.input = input)}
onKeyPress={this.onKeyPressed}
type="text"
placeholder="Name"
/>
我尝试了如下几种组合:
const styles = {
border: {
"&::before": {
border: "1px solid #90caf9"
},
"&:hover:not(.Mui-disabled):before": {
border: "2px solid #90caf9"
},
"&::after": {
border: "2px solid #90caf9"
}
}
};
const DarkTextField = withStyles(styles)(props => {
const { classes, ...other } = props;
return <TextField InputProps={{ className: classes.border }} {...other} />;
});
我不知道如何指定边界。另外,我想控制占位符文本的颜色。
解决方案
推荐阅读
- python - 与 physt polar_map 中的直方图颜色条交互
- kubernetes - 无法从 Istio Mesh 连接到外部 Kafka 服务
- python - 子集列和重新排序
- r - ggplot2中的次轴刻度
- react-native - React Navigation v5,向我的应用程序标题添加堆栈导航
- html - 移动键盘后表单跳起来
- javascript - html dom准备好后如何在“新创建的链接点击”上调用ajax
- django - 部署到 Heroku 后更改文件路径以访问 views.py 中的静态文件
- php - PHP - 尝试使用 proc_open 执行 git push 后读取流时出现无限循环
- c# - 在 ASP.NET Core MVC 控制器中使用 DeleteConfirmed 类捕获 SqlException 547 时出现问题