Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/243.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
如何在我的React项目中使用SCSS全局变量和混合?_Css_Reactjs_Sass - Fatal编程技术网

如何在我的React项目中使用SCSS全局变量和混合?

如何在我的React项目中使用SCSS全局变量和混合?,css,reactjs,sass,Css,Reactjs,Sass,我的global.scss文件中有此变量: $orange:#ee6123 我想在组件的样式表中使用它(在header.scss中): 全局样式表位于/static/css/global.scss中,组件样式表位于src/components/Header/index.scss。全局样式表包含在我的基本src/index.jsx文件中。组件样式表包含在src/components/Header/index.jsx中。有没有办法在组件的样式表中使用$orange变量 .header { backg

我的
global.scss
文件中有此变量:

$orange:#ee6123

我想在组件的样式表中使用它(在
header.scss
中):

全局样式表位于
/static/css/global.scss
中,组件样式表位于
src/components/Header/index.scss
。全局样式表包含在我的基本
src/index.jsx
文件中。组件样式表包含在
src/components/Header/index.jsx
中。有没有办法在组件的样式表中使用
$orange
变量

.header { background: $orange; }