Advertisement
Juc1

gulp sass error: undefined variable

Jun 2nd, 2016
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.56 KB | None | 0 0
  1. temple:/data/disk/o1/static/z-themes/helen# gulp sass
  2. [19:18:17] Using gulpfile /data/disk/o1/static/z-themes/helen/gulpfile.js
  3. [19:18:17] Starting 'sass'...
  4. [19:18:17] Finished 'sass' after 27 ms
  5. Error in plugin 'sass'
  6. Message:
  7. sass/base/body.scss
  8. Error: Undefined variable: "$dark-grey".
  9. on line 9 of sass/base/body.scss
  10. >> color:$dark-grey;
  11. ------^
  12.  
  13. temple:/data/disk/o1/static/z-themes/helen# cat sass/variables/colors.scss
  14. $dark-grey:#202528;
  15. $red:#db4048;
  16. temple:/data/disk/o1/static/z-themes/helen# cat gulpfile.js
  17. 'use strict';
  18. var gulp = require('gulp');
  19. var sass = require('gulp-sass');
  20. var sourcemaps = require('gulp-sourcemaps');
  21. var autoprefixer = require('gulp-autoprefixer');
  22. var importer = require('node-sass-globbing');
  23. var plumber = require('gulp-plumber');
  24. var browserSync = require('browser-sync').create();
  25. var cssmin = require('gulp-cssmin');
  26. var uncss = require('gulp-uncss');
  27. var stripCssComments = require('gulp-strip-css-comments');
  28. var uglify = require('gulp-uglify');
  29. var livereload = require('gulp-livereload')
  30. var sass_config = {
  31. importer: importer,
  32. includePaths: [
  33. 'node_modules/breakpoint-sass/stylesheets/',
  34. 'node_modules/singularitygs/stylesheets/',
  35. 'node_modules/modularscale-sass/stylesheets',
  36. 'node_modules/compass-mixins/lib/'
  37. ]
  38. };
  39.  
  40. //Uglifies javascript
  41. gulp.task('uglify', function() {
  42. return gulp.src('js/*.js')
  43. .pipe(uglify())
  44. .pipe(gulp.dest('js_min'));
  45. });
  46.  
  47. //Compiles sass
  48. gulp.task('sass', function () {
  49. gulp.src('./sass/**/*.scss')
  50. .pipe(plumber())
  51. .pipe(sourcemaps.init())
  52. .pipe(sass(sass_config).on('error', sass.logError))
  53. .pipe(autoprefixer({
  54. browsers: ['last 2 version']
  55. }))
  56. .pipe(stripCssComments({preserve: false}))
  57. .pipe(cssmin())
  58. .pipe(sourcemaps.write('.'))
  59. .pipe(gulp.dest('./css'));
  60. });
  61.  
  62. //Type "gulp" on the command line to watch file changes
  63. gulp.task('default', function(){
  64. livereload.listen();
  65. gulp.watch('./sass/**/*.scss', ['sass']);
  66. gulp.watch('./js/*.js', ['uglify']);
  67. gulp.watch(['./css/style.css', './**/*.twig', './js_min/*.js'], function (files){
  68. livereload.changed(files)
  69. });
  70. });
  71. temple:/data/disk/o1/static/z-themes/helen# cat sass/styles.scss
  72. // Import external libraries.
  73. @import "compass";
  74. @import "singularitygs";
  75. @import "breakpoint";
  76.  
  77. // Import sass partials
  78. @import "sass/variables/**/*.scss";
  79. @import "sass/abstractions/**/*.scss";
  80. @import "sass/base/**/*.scss";
  81. @import "sass/components/**/*.scss";
  82. temple:/data/disk/o1/static/z-themes/helen#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement