使用Css模块@import@value创建react应用程序
我正在使用CreateReact应用程序和css模块,如 在main.css文件中,我定义了如下变量使用Css模块@import@value创建react应用程序,css,reactjs,create-react-app,css-modules,Css,Reactjs,Create React App,Css Modules,我正在使用CreateReact应用程序和css模块,如 在main.css文件中,我定义了如下变量 @value BestColor: #c6a972; 在我的component.module.css文件中,我使用了这些变量 @value variables: "../../../index.css"; @value BestColor variables; .aVeryNiceComponent { color: BestColor; } 我在Webstorm上使用带有TsLi
@value BestColor: #c6a972;
在我的component.module.css文件中,我使用了这些变量
@value variables: "../../../index.css";
@value BestColor variables;
.aVeryNiceComponent {
color: BestColor;
}
我在Webstorm上使用带有TsLint的Typescript。
是否有任何方法可以lint并检查BestColor值是否存在,以及是否正在引用on index.css文件
现在可以添加一种新的颜色,如这里所示,但是index.css上不存在该变量,并且会以静默方式失败
@value variables: "../../../index.css";
@value BestColor, WhiteBG variables;
.aVeryNiceComponent {
color: BestColor;
background-color: WhiteBG;
}