Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/visual-studio-2010/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用Css模块@import@value创建react应用程序_Css_Reactjs_Create React App_Css Modules - Fatal编程技术网

使用Css模块@import@value创建react应用程序

使用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

我正在使用CreateReact应用程序和css模块,如

在main.css文件中,我定义了如下变量

@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;
}