Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/278.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 SASS:Can';t在文件之间共享变量_Css_Sass - Fatal编程技术网

Css SASS:Can';t在文件之间共享变量

Css SASS:Can';t在文件之间共享变量,css,sass,Css,Sass,我有一个名为app.scss的文件,在该文件中我制作了四个@imports: @import "settings"; @import "foundation"; @import "type"; @import "custom"; 我正在设置中定义一个$main color变量,如下所示。scss: $main-color: blue; 但由于某种原因,当我在custom.scss中引用该文件时,我得到一个错误: body { background-color: $main-color

我有一个名为
app.scss
的文件,在该文件中我制作了四个
@import
s:

@import "settings";
@import "foundation";
@import "type";
@import "custom";
我正在
设置中定义一个
$main color
变量,如下所示。scss

$main-color: blue;
但由于某种原因,当我在
custom.scss
中引用该文件时,我得到一个错误:

body {
    background-color: $main-color;
}

知道是什么导致了这个问题吗?提前谢谢

您应该将settings.scss/custom.scss重命名为_settings.scss/_custom.scss。

您是否正在导入
自定义文件中的
设置