简体   繁体   English

未定义的scss变量错误

[英]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.

相关问题 使用 Gulp 时 SCSS 未定义变量错误 - SCSS Undefined variable error when using Gulp 如何修复 SCSS 中的未定义变量错误? - How to fix an Undefined Variable Error in SCSS? scss中未定义的变量 - Undefined variable in scss React & SCSS: SassError: 未定义的变量 - React & SCSS: SassError: Undefined variable 使用 node-sass 编译 SCSS 时出现未定义变量错误 - Getting Undefined variable error when compiling SCSS using node-sass 在 vs 代码中使用 sass 实时服务器编译时 scss 中的未定义变量错误 - Undefined variable error in scss while compiling using sass live server in vs code 此SCSS功能的语法是否不正确? 未定义的操作错误: - Is the syntax for this SCSS function incorrect? Undefined operation error: SCSS 编译为 CSS 显示错误:未定义的 mixin - SCSS compiling to CSS shows Error: Undefined mixin SCSS 未定义变量:"$general-grey" 但该变量实际上已定义且不同 - SCSS Undefined variable: "$general-grey" but the variable is actually defined and different npm 启动时出错 - 未定义变量:\\node_modules\\bootstrap\\scss\\mixins\\_grid-framework.scss 中的“$grid-row-columns”(第 37 行,第 30 列) - error while npm start - Undefined variable: "$grid-row-columns" in \node_modules\bootstrap\scss\mixins\_grid-framework.scss (line 37, column 30)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM