Material-ui: 更改文本字段上输入文本的颜色

创建于 2015-10-22  ·  3评论  ·  资料来源: mui-org/material-ui

在查看文档和代码后,似乎没有一种好方法可以更改输入字段本身内的文本颜色。 默认颜色为黑色rgba(0, 0, 0, 0.87) 。 类似于underlineFocusStylehintStyle会很棒。

最有用的评论

它不在文档中,但您可以使用 inputStyle 作为 TextField 的道具来直接设置输入样式。

所有3条评论

如果您需要更改应用程序或组件中所有输入的文本颜色,则可以使用主题覆盖来执行此操作。 请参阅http://material-ui.com/#/customization/themes 的_Overriding Theme Variables_ 部分

正如我所见,输入文本在 textField.textColor 中定义:
https://github.com/callemall/material-ui/blob/master/src/styles/theme-manager.js#L185

它不在文档中,但您可以使用 inputStyle 作为 TextField 的道具来直接设置输入样式。

@chmann超级有用。 谢谢你

此页面是否有帮助?
0 / 5 - 0 等级

相关问题

FranBran picture FranBran  ·  3评论

sys13 picture sys13  ·  3评论

ghost picture ghost  ·  3评论

chris-hinds picture chris-hinds  ·  3评论

finaiized picture finaiized  ·  3评论