简体   繁体   English

如何在反应组件中设置所有文本颜色?

[英]How can I set all text color in react components?

I have multiple components in react project and What I'm trying to do is set all the text on the page to white.我在反应项目中有多个组件,我想要做的是将页面上的所有文本设置为白色。

This is the index.css file:这是 index.css 文件:

:root {
    color: white !important;
}

But it's not working so How can I set every text rendered on the page to white?但它不起作用所以如何将页面上呈现的每个文本设置为白色?

*{
    color: white !important;
}

Try this one.试试这个。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用 React/Redux 查找所有嵌套组件? - How can I find all nested Components using React/Redux? React-如何将所有组件导入一个 - React - How can I import all my components into one 如何仅更改反应组件的突出显示文本颜色? - how can I change highlight text color for only a react component? 如何使用反应钩子分别更改文本的颜色? - How can I change the color of the text separately with react hooks? 如何为 canvas HTML 的文本和背景设置不同的颜色? - How can I set a different color for text and background of canvas HTML? 如何为带有样式组件的文本组件设置自定义颜色? - How to set customized color for a Text component with styled-components? 如何在 React JS 中为文本设置颜色 - How to set color to text in React JS 如何使用 React 样式的组件正确设置链接以响应图标 - How can i proper set link to react icon using React styled components 如何对在子组件中具有所有文本字段的React应用进行单元测试? - How do i unit test a react app that has all the text fields in the children components? 如何在带有CreateStackNavigator的React Native中将StatusBar设置为某种背景色,并将Header背景色设置为另一种背景色? - How can I set the StatusBar to a certain background color, and the Header background color to another one in React Native with CreateStackNavigator?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM