CSS自定义属性在React生产构建中不起作用
我有几个自定义的CSS属性在根上定义了,并且它们在开发构建方面工作正常,但是它们在生产构建中没有加载。 自定义属性是在index.css中定义的。
:root {
--light-theme-background-color: #fafafa;
--light-theme-text-color: #333;
--light-theme-active-color: #cbcbcb;
--dark-theme-background-color: #1d2327;
--dark-theme-text-color: #227093;
--dark-theme-active-color: #343434;
}
在开发工具中,自定义属性是灰色的,当我徘徊时,我会收到未定义它们的消息。
I have several custom css properties defined on the root, and they are working fine on the development build, however they aren't loading on the production build.
The custom properties are defined in index.css.
:root {
--light-theme-background-color: #fafafa;
--light-theme-text-color: #333;
--light-theme-active-color: #cbcbcb;
--dark-theme-background-color: #1d2327;
--dark-theme-text-color: #227093;
--dark-theme-active-color: #343434;
}
In the dev tools the custom properties are grayed out and when I hover I get the message that they are not defined.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论