[英]Undefined scss variable error
I'm trying to compile my SCSS and I'm having a pretty inexplicable gulp error. 我正在尝试编译我的SCSS,却遇到了一个莫名其妙的吞咽错误。
So I checked my code and everything appears fine. 所以我检查了我的代码,一切看起来都很好。 Here's the variable in my _colors.scss file. 这是我的_colors.scss文件中的变量。
// dark shades
$gray1: #3c3c3d !default;
$gray2: #5a5a5b !default;
$gray3: #7d7d7e !default;
And here's the line that is triggering the error in _base.scss 这是在_base.scss中触发错误的行
body{
box-sizing: border-box;
color: $gray1;
font-family: $base-font;
font-size: $font-size;
line-height: $line-height;
min-height: 100%;
position: relative;
}
And here's my gulpfile css task that I ran. 这是我运行的gulpfile css任务。
gulp.task('css', function() {
return sass('scss/**/*.scss')
.pipe(sourcemaps.init())
.pipe(autoprefixer())
.pipe(concat('styles.css'))
.on('error', sass.logError)
.pipe(sourcemaps.write())
.pipe(gulp.dest('./css'))
.pipe(notify({ message: 'Wait for it....wait for it!!!' }));
});
All of my code is also in this repository in case you want to poke around (it's not much yet) 我所有的代码也都存储在此存储库中,以防万一(不多)
您是否在_base.scss之前包含了_collors.scss,如果不是,可能是因为它在编译时不知道该变量,因为它在以后会被导入
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.