├── .editorconfig ├── .gitignore ├── .jscsrc ├── .jshintrc ├── .npmignore ├── .travis.yml ├── LICENSE ├── README.md ├── gulpfile.js ├── lib ├── callCounter.js ├── compass.js ├── helpers.js └── index.js ├── package.json └── test ├── Gemfile ├── bower_components └── _base.scss ├── bower_components2 └── _base2.scss ├── callCounter_test.js ├── compass_test.js ├── config.rb ├── expected ├── compile.css ├── compile2.css ├── import.css ├── import2.css ├── partial.css ├── require.css ├── simple.css └── spriting.css ├── images └── my-icons │ ├── edit.png │ └── new.png └── sass ├── _imported.scss ├── base ├── compile.scss ├── compile2.scss └── compile3.scss ├── compile.scss ├── error.scss ├── import.scss ├── import2.scss ├── multiple-require.scss ├── partial.scss ├── partial ├── _base_1.scss └── _base_2.scss ├── require.scss ├── simple.sass ├── simple2.sass └── spriting.scss /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | end_of_line = lf 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | 14 | [Makefile] 15 | indent_style = tab 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *.log 3 | node_modules 4 | build 5 | *.node 6 | components 7 | .sass-cache 8 | test/css 9 | test/images/*.png 10 | coverage/ 11 | -------------------------------------------------------------------------------- /.jscsrc: -------------------------------------------------------------------------------- 1 | { 2 | "preset": "airbnb", 3 | "excludeFiles": ["node_modules/**", "libs/**"] 4 | } 5 | -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "node": true, 3 | "browser": true, 4 | "esnext": true, 5 | "bitwise": true, 6 | "curly": true, 7 | "eqeqeq": true, 8 | "immed": true, 9 | "indent": 2, 10 | "newcap": true, 11 | "noarg": true, 12 | "quotmark": "single", 13 | "undef": true, 14 | "unused": "vars", 15 | "strict": true, 16 | "camelcase": false, 17 | "expr": true, // http://stackoverflow.com/questions/13815569/how-to-get-should-be-false-syntax-pass-jslint 18 | "globals": { 19 | "describe": false, 20 | "it": false, 21 | "before": false, 22 | "beforeEach": false, 23 | "after": false, 24 | "afterEach": false, 25 | "should": false 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *.log 3 | node_modules 4 | build 5 | *.node 6 | components 7 | coverage 8 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | 3 | language: node_js 4 | 5 | node_js: 6 | - 4 7 | 8 | before_install: 9 | - gem update --system 10 | - gem install compass 11 | - gem install sass-globbing 12 | - gem install susy 13 | - gem install modular-scale 14 | 15 | script: 16 | - npm test 17 | 18 | after_script: 19 | - cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js 20 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Bo-Yi Wu 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # [gulp](http://gulpjs.com/)-compass 2 | 3 | [![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status](https://travis-ci.org/appleboy/gulp-compass.png?branch=master)](https://travis-ci.org/appleboy/gulp-compass) [![Dependency Status](https://david-dm.org/appleboy/gulp-compass.svg)](https://david-dm.org/appleboy/gulp-compass) [![Coverage Status](https://coveralls.io/repos/appleboy/gulp-compass/badge.svg?branch=master)](https://coveralls.io/r/appleboy/gulp-compass?branch=master) 4 | 5 | [![NPM](https://nodei.co/npm/gulp-compass.png?downloads=true&stars=true)](https://nodei.co/npm/gulp-compass/) 6 | 7 | > Compile Sass to CSS using Compass 8 | 9 | [npm-url]: https://www.npmjs.org/package/gulp-compass 10 | [npm-image]: http://img.shields.io/npm/v/gulp-compass.svg 11 | [downloads-image]: http://img.shields.io/npm/dm/gulp-compass.svg 12 | 13 | ## Requirements 14 | 15 | `gulp-compass` requires the compass ruby gem in order to compile compass. This can easily be installed via Terminal. 16 | 17 | ``` 18 | $ gem update --system 19 | $ gem install compass 20 | ``` 21 | 22 | Please refer the [user guide](http://compass-style.org/install/) 23 | 24 | ## Installation 25 | 26 | Install with [npm](https://npmjs.org/package/gulp-compass) 27 | 28 | ``` 29 | $ npm install gulp-compass --save-dev 30 | ``` 31 | 32 | ## Usage 33 | 34 | ### Load config from config.rb 35 | 36 | Please **make sure** to add ``css`` and ``sass`` options with the same value in ``config.rb`` since ``compass`` can't output css result directly. 37 | 38 | * ``css`` default value is ``css``. 39 | * ``sass`` default value is ``sass``. 40 | 41 | ```javascript 42 | var compass = require('gulp-compass'); 43 | 44 | gulp.task('compass', function() { 45 | gulp.src('./src/*.scss') 46 | .pipe(compass({ 47 | config_file: './config.rb', 48 | css: 'stylesheets', 49 | sass: 'sass' 50 | })) 51 | .pipe(gulp.dest('app/assets/temp')); 52 | }); 53 | ``` 54 | 55 | ### Load config without config.rb 56 | 57 | set your project path. 58 | 59 | ```javascript 60 | var compass = require('gulp-compass'), 61 | path = require('path'); 62 | 63 | gulp.task('compass', function() { 64 | gulp.src('./src/*.scss') 65 | .pipe(compass({ 66 | project: path.join(__dirname, 'assets'), 67 | css: 'css', 68 | sass: 'sass' 69 | })) 70 | .pipe(gulp.dest('app/assets/temp')); 71 | }); 72 | ``` 73 | 74 | set your compass settings. 75 | 76 | ```javascript 77 | var compass = require('gulp-compass'), 78 | minifyCSS = require('gulp-minify-css'); 79 | 80 | gulp.task('compass', function() { 81 | gulp.src('./src/*.scss') 82 | .pipe(compass({ 83 | css: 'app/assets/css', 84 | sass: 'app/assets/sass', 85 | image: 'app/assets/images' 86 | })) 87 | .pipe(minifyCSS()) 88 | .pipe(gulp.dest('app/assets/temp')); 89 | }); 90 | ``` 91 | 92 | Support multiple require option 93 | 94 | ```javascript 95 | var compass = require('gulp-compass'), 96 | minifyCSS = require('gulp-minify-css'); 97 | 98 | gulp.task('compass', function() { 99 | gulp.src('./src/*.scss') 100 | .pipe(compass({ 101 | css: 'app/assets/css', 102 | sass: 'app/assets/sass', 103 | image: 'app/assets/images', 104 | require: ['susy', 'modular-scale'] 105 | })) 106 | .pipe(minifyCSS()) 107 | .pipe(gulp.dest('app/assets/temp')); 108 | }); 109 | ``` 110 | 111 | Support return the output of the Compass as the callback 112 | 113 | ```javascript 114 | var compass = require('gulp-compass'), 115 | minifyCSS = require('gulp-minify-css'); 116 | 117 | gulp.task('compass', function() { 118 | gulp.src('./src/*.scss') 119 | .pipe(compass({ 120 | css: 'app/assets/css', 121 | sass: 'app/assets/sass', 122 | image: 'app/assets/images' 123 | })) 124 | .on('error', function(error) { 125 | // Would like to catch the error here 126 | console.log(error); 127 | this.emit('end'); 128 | }) 129 | .pipe(minifyCSS()) 130 | .pipe(gulp.dest('app/assets/temp')); 131 | }); 132 | ``` 133 | 134 | `gulp-compass` with [gulp-plumber](https://github.com/floatdrop/gulp-plumber) 135 | 136 | ```javascript 137 | var compass = require('gulp-compass'), 138 | plumber = require('gulp-plumber'), 139 | minifyCSS = require('gulp-minify-css'); 140 | 141 | gulp.task('compass', function() { 142 | gulp.src('./src/*.scss') 143 | .pipe(plumber({ 144 | errorHandler: function (error) { 145 | console.log(error.message); 146 | this.emit('end'); 147 | }})) 148 | .pipe(compass({ 149 | css: 'app/assets/css', 150 | sass: 'app/assets/sass', 151 | image: 'app/assets/images' 152 | })) 153 | .on('error', function(err) { 154 | // Would like to catch the error here 155 | }) 156 | .pipe(minifyCSS()) 157 | .pipe(gulp.dest('app/assets/temp')); 158 | }); 159 | ``` 160 | 161 | ## Configuration 162 | 163 | ### Configuration Options 164 | 165 | #### style 166 | 167 | **default:** nested 168 | 169 | **description:** The output style for the compiled css. 170 | One of: nested, expanded, compact, or compressed. 171 | 172 | #### comments 173 | 174 | **default:** false 175 | 176 | **description:** Show line comments or not. 177 | 178 | #### relative 179 | 180 | **default:** true 181 | 182 | **description:** Are assets relative. 183 | 184 | #### css 185 | 186 | **default:** css 187 | 188 | **description:** The target directory where you keep your css stylesheets. It is relative to the ``project`` option. 189 | 190 | #### sass 191 | 192 | **default:** sass 193 | 194 | **description:** The source directory where you keep your sass stylesheets. It is relative to the ``project`` option. 195 | 196 | #### javascript 197 | 198 | **default:** js 199 | 200 | **description:** The directory where you keep your javascripts. It is relative to the ``project`` option. 201 | 202 | #### font 203 | 204 | **default:** font 205 | 206 | **description:** The directory where you keep your fonts. It is relative to the ``project`` option. 207 | 208 | #### project 209 | 210 | **default:** your project base 211 | 212 | **description:** The location where all your assets are store. 213 | 214 | #### logging 215 | 216 | **default:** true 217 | 218 | **description:** show/hide compile log message. 219 | 220 | #### import_path 221 | 222 | **default:** false 223 | 224 | **format:** ``string`` or ``array`` 225 | 226 | **description:** The directory where you keep external Compass plugins or extensions that you would like to make available using the `@import` function. Common use case would be setting this to your `bower_components` directory for example. It is relative to the ``project`` option. 227 | 228 | #### require 229 | 230 | **default:** false 231 | 232 | **format:** ``string`` or ``array`` 233 | 234 | **description:** Require the given Ruby library before running commands. This is used to access Compass plugins without having a project configuration file. 235 | 236 | #### load_all 237 | 238 | **default:** false 239 | 240 | **description:** Load all the frameworks or extensions found in the FRAMEWORKS_DIR directory. 241 | 242 | #### bundle_exec 243 | 244 | **default:** false 245 | 246 | **description:** Run compass compile with [bundle exec](http://bundler.io/v1.5/man/bundle-exec.1.html): ``bundle exec compass compile``. 247 | 248 | #### sourcemap 249 | 250 | **default:** false 251 | 252 | **description:** Generate standard JSON source maps. 253 | 254 | PS. Past compass versions (prior to 1.0.0) do not support `--sourcemap` flag, please update sass and compass as the following version. 255 | 256 | ``` 257 | * sass (3.3.3) 258 | * compass (1.0.1) 259 | ``` 260 | 261 | #### time 262 | 263 | **default:** false 264 | 265 | **description:** Display compilation times. 266 | 267 | #### debug 268 | 269 | **default:** false 270 | 271 | **description:** Turns on sass's debuging information. 272 | 273 | #### environment 274 | 275 | **description:** The environment mode can also be `development` or `production`. 276 | 277 | #### http_path 278 | 279 | **default:** false 280 | 281 | **description:** Set this to the root of your project when deployed. 282 | 283 | #### generated_images_path 284 | 285 | **default:** false 286 | 287 | **description:** GENERATED_IMAGES_PATH. Support `--generated-images-path` parameter. 288 | 289 | #### task 290 | 291 | **default:** compile 292 | 293 | **description:** Support compass primary commands: compile or watch. 294 | 295 | 296 | ## Running tests 297 | 298 | ``` 299 | $ gem install compass 300 | $ gem install susy 301 | $ gem install sass-globbing 302 | $ gem install modular-scale 303 | $ npm test 304 | ``` 305 | -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var gulp = require('gulp'); 4 | var $ = require('gulp-load-plugins')(); 5 | var del = require('del'); 6 | var lib = ['**/*.js', '!test/**/*', '!node_modules/**/*', '!coverage/**/*']; 7 | 8 | function mochaStream() { 9 | return gulp.src('test/*_test.js', {read: false}) 10 | .pipe($.mocha({ 11 | reporter: 'spec' 12 | })); 13 | } 14 | 15 | gulp.task('coverage', ['clean'], function() { 16 | return gulp.src(lib) 17 | .pipe($.istanbul()) 18 | .pipe($.istanbul.hookRequire()); 19 | }); 20 | 21 | gulp.task('jscs', function() { 22 | return gulp.src(lib) 23 | .pipe($.jscs()); 24 | }); 25 | 26 | gulp.task('jshint', function() { 27 | return gulp.src(lib) 28 | .pipe($.jshint()) 29 | .pipe($.jshint.reporter('jshint-reporter-jscs')) 30 | .pipe($.jshint.reporter('fail')); 31 | }); 32 | 33 | gulp.task('mocha', ['coverage'], function() { 34 | return mochaStream() 35 | .pipe($.istanbul.writeReports()); 36 | }); 37 | 38 | gulp.task('mocha:nocov', function() { 39 | return mochaStream(); 40 | }); 41 | 42 | gulp.task('clean', del.bind(null, ['test/css', 'coverage/**/*'])); 43 | 44 | gulp.task('default', ['mocha', 'jshint']); 45 | -------------------------------------------------------------------------------- /lib/callCounter.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = function(pendingResponses, cb) { 4 | var fire = function() { 5 | cb(); 6 | cb = function() {}; 7 | }; 8 | 9 | if (pendingResponses < 1) { 10 | fire(); 11 | } 12 | 13 | return function() { 14 | if (--pendingResponses <= 0) { 15 | fire(); 16 | } 17 | }; 18 | }; 19 | -------------------------------------------------------------------------------- /lib/compass.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var PLUGIN_NAME = 'gulp-compass'; 4 | var path = require('path'); 5 | var spawn = require('child_process').spawn; 6 | var gutil = require('gulp-util'); 7 | var path = require('path'); 8 | var helpers = require('./helpers'); 9 | var defaults = { 10 | style: false, 11 | comments: false, 12 | relative: true, 13 | css: 'css', 14 | sass: 'sass', 15 | image: false, 16 | generated_images_path: false, 17 | http_path: false, 18 | javascript: false, 19 | font: false, 20 | import_path: false, 21 | config_file: false, 22 | require: false, 23 | logging: true, 24 | load_all: false, 25 | project: process.cwd(), 26 | bundle_exec: false, 27 | debug: false, 28 | time: false, 29 | sourcemap: false, 30 | boring: false, 31 | force: false, 32 | task: 'compile' 33 | }; 34 | 35 | module.exports = function(files, opts, callback) { 36 | if ('string' === typeof files) { 37 | files = [files]; 38 | } 39 | 40 | opts = opts || {}; 41 | 42 | var filePaths = [], 43 | pathsToCss = []; 44 | 45 | for (var key in defaults) { 46 | if (opts[key] === undefined) { 47 | opts[key] = defaults[key]; 48 | } 49 | } 50 | 51 | files.forEach(function(file) { 52 | file = file.replace(/\\/g, '/'); 53 | var relPathToSass = path.relative(path.resolve(opts.project, opts.sass), file); 54 | pathsToCss.push(path.resolve(opts.project, opts.css, gutil.replaceExtension(relPathToSass, '.css'))); 55 | filePaths.push(file); 56 | }); 57 | 58 | var compassExecutable = 'compass'; 59 | 60 | // check command exist 61 | if (opts.bundle_exec) { 62 | compassExecutable = helpers.command('bundle', callback); 63 | } else { 64 | compassExecutable = helpers.command(compassExecutable, callback); 65 | } 66 | 67 | if (!compassExecutable) { 68 | return false; 69 | } 70 | 71 | var options = []; 72 | if (opts.bundle_exec) { 73 | options.push('exec', 'compass'); 74 | } 75 | 76 | options.push(opts.task); 77 | if (process.platform === 'win32') { 78 | options.push(opts.project.replace(/\\/g, '/')); 79 | } else { 80 | options.push(opts.project); 81 | } 82 | 83 | if (opts.task !== 'watch') { 84 | filePaths.forEach(function(file) { 85 | options.push(file); 86 | }); 87 | } 88 | 89 | // set compass setting 90 | if (opts.environment) { options.push('--environment', opts.environment); } 91 | 92 | if (opts.config_file) { options.push('-c', opts.config_file); } 93 | 94 | if (!opts.comments) { options.push('--no-line-comments'); } 95 | 96 | if (opts.relative) { options.push('--relative-assets'); } 97 | 98 | if (opts.debug) { options.push('--debug-info'); } 99 | 100 | if (opts.time) { options.push('--time'); } 101 | 102 | if (opts.boring) { options.push('--boring'); } 103 | 104 | if (opts.sourcemap) { options.push('--sourcemap'); } 105 | 106 | if (opts.font) { options.push('--fonts-dir', opts.font); } 107 | 108 | if (opts.style) { options.push('--output-style', opts.style); } 109 | 110 | if (opts.image) { options.push('--images-dir', opts.image); } 111 | 112 | if (opts.generated_images_path) { options.push('--generated-images-path', opts.generated_images_path); } 113 | 114 | if (opts.http_path) { options.push('--http-path', opts.http_path); } 115 | 116 | if (opts.javascript) { options.push('--javascripts-dir', opts.javascript); } 117 | 118 | if (opts.force) { options.push('--force'); } 119 | 120 | options.push('--css-dir', path.normalize(opts.css)); 121 | options.push('--sass-dir', path.normalize(opts.sass)); 122 | 123 | if (opts.import_path) { 124 | if (helpers.isArray(opts.import_path)) { 125 | opts.import_path.forEach(function(i) { 126 | options.push('-I', i); 127 | }); 128 | } else { 129 | options.push('-I', opts.import_path); 130 | } 131 | } 132 | 133 | if (opts.load_all) { options.push('--load-all', opts.load_all); } 134 | 135 | if (opts.require) { 136 | if (helpers.isArray(opts.require)) { 137 | opts.require.forEach(function(f) { 138 | options.push('--require', f); 139 | }); 140 | } else { 141 | options.push('--require', opts.require); 142 | } 143 | } 144 | 145 | if (opts.debug) { 146 | gutil.log(PLUGIN_NAME + ':', 'Running command:', compassExecutable, options.join(' ')); 147 | } 148 | 149 | var child = spawn(compassExecutable, options, {cwd: opts.project || process.cwd()}); 150 | var stdout = ''; 151 | var stderr = ''; 152 | 153 | if (opts.logging) { 154 | child.stdout.setEncoding('utf8'); 155 | child.stdout.on('data', function(data) { 156 | stdout += data; 157 | console.log(data); 158 | }); 159 | 160 | child.stderr.setEncoding('utf8'); 161 | child.stderr.on('data', function(data) { 162 | stderr += data; 163 | if (!data.match(/^\u001b\[\d+m$/)) { 164 | gutil.log(data); 165 | } 166 | }); 167 | } 168 | 169 | // support callback 170 | child.on('close', function(code) { 171 | if (callback) { 172 | callback(code, stdout, stderr, pathsToCss, opts); 173 | } 174 | }); 175 | }; 176 | -------------------------------------------------------------------------------- /lib/helpers.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var which = require('which').sync; 4 | 5 | module.exports.isArray = function(obj) { 6 | return Object.prototype.toString.call(obj) === '[object Array]'; 7 | }; 8 | 9 | module.exports.command = function(cmd, callback) { 10 | var command; 11 | 12 | try { 13 | command = which(cmd); 14 | } catch (err) { 15 | 16 | if (callback) { 17 | callback(127, '', String(err), ''); 18 | } 19 | 20 | return false; 21 | } 22 | 23 | return command; 24 | }; 25 | -------------------------------------------------------------------------------- /lib/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var fs = require('fs'); 4 | var compass = require('./compass'); 5 | var callCounter = require('./callCounter'); 6 | var through = require('through2'); 7 | var gutil = require('gulp-util'); 8 | var path = require('path'); 9 | 10 | // Consts 11 | var PLUGIN_NAME = 'gulp-compass'; 12 | 13 | module.exports = function(opt) { 14 | var files = []; 15 | 16 | var collectNames = function(file, enc, cb) { 17 | if (file.isNull()) { 18 | return cb(null, file); 19 | } 20 | 21 | if (file.isStream()) { 22 | return cb(new gutil.PluginError(PLUGIN_NAME, 'Streaming not supported')); 23 | } 24 | 25 | if (path.basename(file.path)[0] !== '_') { 26 | files.push(file); 27 | } 28 | 29 | return cb(); 30 | }; 31 | 32 | var readFileAndPush = function(pathToCss, outputStream, cb) { 33 | // Read each generated file so it can continue being streamed. 34 | fs.readFile(pathToCss, function(err, contents) { 35 | if (err) { 36 | return cb(new gutil.PluginError(PLUGIN_NAME, 'Failure reading in the CSS output file')); 37 | } 38 | 39 | // Fix garbled output. 40 | if (!(contents instanceof Buffer)) { 41 | contents = new Buffer(contents); 42 | } 43 | 44 | outputStream.push(new gutil.File({ 45 | base: opt.css, 46 | path: pathToCss, 47 | contents: contents 48 | })); 49 | 50 | cb(); 51 | }); 52 | }; 53 | 54 | var compile = function(cb) { 55 | var _this = this; 56 | var fileNames = files.map(function(f) { 57 | return f.path; 58 | }); 59 | 60 | compass(fileNames, opt, function(code, stdout, stderr, pathsToCss, options) { 61 | if (code === 127) { 62 | return cb(new gutil.PluginError(PLUGIN_NAME, 'You need to have Ruby and Compass installed ' + 63 | 'and in your system PATH for this task to work.')); 64 | } 65 | 66 | // support error callback 67 | if (code !== 0) { 68 | return cb(new gutil.PluginError(PLUGIN_NAME, stdout || 'Compass failed')); 69 | } 70 | 71 | cb = callCounter(files.length, cb); 72 | pathsToCss.forEach(function(f) { 73 | readFileAndPush(f, _this, cb); 74 | }); 75 | }); 76 | }; 77 | 78 | return through.obj(collectNames, compile); 79 | }; 80 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "gulp-compass", 3 | "version": "2.1.0", 4 | "description": "Compile Compass files", 5 | "main": "lib", 6 | "repository": { 7 | "type": "git", 8 | "url": "git://github.com/appleboy/gulp-compass.git" 9 | }, 10 | "keywords": [ 11 | "gulp", 12 | "gulpplugin", 13 | "compass", 14 | "scss", 15 | "sass", 16 | "css", 17 | "compile", 18 | "preprocessor", 19 | "style" 20 | ], 21 | "author": "Bo-Yi Wu", 22 | "license": "MIT", 23 | "bugs": { 24 | "url": "https://github.com/appleboy/gulp-compass/issues" 25 | }, 26 | "homepage": "https://github.com/appleboy/gulp-compass", 27 | "dependencies": { 28 | "gulp-util": "^3.0.4", 29 | "through2": "^2.0.1", 30 | "which": "^1.1.1" 31 | }, 32 | "devDependencies": { 33 | "coveralls": "^2.11.2", 34 | "del": "^2.2.1", 35 | "gulp": "^3.8.10", 36 | "gulp-istanbul": "^1.0.0", 37 | "gulp-jscs": "^4.0.0", 38 | "gulp-jshint": "^2.0.1", 39 | "gulp-load-plugins": "^1.2.1", 40 | "gulp-mocha": "^3.0.0", 41 | "iconv-lite": "^0.4.7", 42 | "jshint-reporter-jscs": "^0.1.0", 43 | "map-stream": "0.0.5", 44 | "mocha": "^3.0.0", 45 | "should": "^11.0.0" 46 | }, 47 | "engines": { 48 | "node": ">= 4" 49 | }, 50 | "scripts": { 51 | "test": "gulp" 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /test/Gemfile: -------------------------------------------------------------------------------- 1 | # A sample Gemfile 2 | source "https://rubygems.org" 3 | 4 | # gem "rails" 5 | 6 | gem 'sass', ">= 3.4.11" 7 | gem 'sass-globbing', ">= 1.1.0" 8 | gem 'compass', ">= 1.0.3" 9 | -------------------------------------------------------------------------------- /test/bower_components/_base.scss: -------------------------------------------------------------------------------- 1 | $font-color : #333; 2 | @import "compass/reset"; 3 | 4 | body { 5 | color: $font-color; 6 | } 7 | -------------------------------------------------------------------------------- /test/bower_components2/_base2.scss: -------------------------------------------------------------------------------- 1 | $foot_color: #ccc; 2 | 3 | .footer { 4 | color: $foot_color; 5 | } 6 | -------------------------------------------------------------------------------- /test/callCounter_test.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | var callCounter = require('../lib/callCounter'); 3 | 4 | require('mocha'); 5 | require('should'); 6 | 7 | describe('callCounter', function() { 8 | it('calls the callback when no calls are expected', function() { 9 | var called = 0; 10 | callCounter(0, function(){ called++; }); 11 | called.should.eql(1); 12 | }); 13 | 14 | it('calls the callback when the count is reached', function() { 15 | var called = 0; 16 | var counter = callCounter(3, function(){ called++; }); 17 | called.should.eql(0); 18 | counter(); 19 | called.should.eql(0); 20 | counter(); 21 | called.should.eql(0); 22 | counter(); 23 | called.should.eql(1); 24 | }); 25 | 26 | it('does not call the callback again if the limit is passed', function() { 27 | var called = 0; 28 | var counter = callCounter(1, function(){ called++; }); 29 | called.should.eql(0); 30 | counter(); 31 | called.should.eql(1); 32 | counter(); 33 | called.should.eql(1); 34 | }); 35 | 36 | it('does not call the callback again if the 0 limit is passed', function() { 37 | var called = 0; 38 | var counter = callCounter(0, function(){ called++; }); 39 | called.should.eql(1); 40 | counter(); 41 | called.should.eql(1); 42 | }); 43 | }); 44 | -------------------------------------------------------------------------------- /test/compass_test.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | var fs = require('fs'), 3 | compass = require('../lib/compass'), 4 | helpers = require('../lib/helpers'), 5 | path = require('path'), 6 | iconv = require('iconv-lite'); 7 | 8 | require('mocha'); 9 | require('should'); 10 | 11 | var read_file = function(filepath) { 12 | var contents; 13 | try { 14 | contents = fs.readFileSync(String(filepath)); 15 | contents = iconv.decode(contents, 'utf-8'); 16 | // Strip any BOM that might exist. 17 | if (contents.charCodeAt(0) === 0xFEFF) { 18 | contents = contents.substring(1); 19 | } 20 | return contents; 21 | } catch(e) { 22 | throw new Error('Unable to read "' + filepath + '" file'); 23 | } 24 | }; 25 | 26 | describe('gulp-compass plugin', function() { 27 | describe('compass command', function() { 28 | var actual, expected; 29 | this.timeout(60000); 30 | 31 | it('compile scss to css', function(done) { 32 | compass(path.join(__dirname, 'sass/compile.scss'), { 33 | project: __dirname, 34 | style: 'compressed', 35 | css: 'css', 36 | sass: 'sass', 37 | logging: false 38 | }, function(code, stdout, stderr, new_path) { 39 | code.should.be.equal(0); 40 | stderr.should.be.empty; 41 | new_path.should.eql([__dirname + '/css/compile.css']); 42 | actual = read_file(path.join(__dirname, 'css/compile.css')); 43 | expected = read_file(path.join(__dirname, 'expected/compile.css')); 44 | actual.should.equal(expected); 45 | done(); 46 | }); 47 | }); 48 | 49 | it('compile multiple scss to multiple css', function(done) { 50 | compass([path.join(__dirname, 'sass/compile.scss'), path.join(__dirname, 'sass/simple.sass')], { 51 | project: __dirname, 52 | style: 'compressed', 53 | css: 'css', 54 | sass: 'sass', 55 | logging: false 56 | }, function(code, stdout, stderr, new_path) { 57 | code.should.be.equal(0); 58 | stderr.should.be.empty; 59 | new_path.should.eql([__dirname + '/css/compile.css', __dirname + '/css/simple.css']); 60 | actual = read_file(path.join(__dirname, 'css/compile.css')); 61 | expected = read_file(path.join(__dirname, 'expected/compile.css')); 62 | actual.should.equal(expected); 63 | actual = read_file(path.join(__dirname, 'css/simple.css')); 64 | expected = read_file(path.join(__dirname, 'expected/simple.css')); 65 | actual.should.equal(expected); 66 | done(); 67 | }); 68 | }); 69 | 70 | it('compile sass to css', function(done) { 71 | compass(path.join(__dirname, 'sass/simple.sass'), { 72 | project: __dirname, 73 | style: 'compressed', 74 | css: 'css', 75 | sass: 'sass', 76 | logging: false 77 | }, function(code, stdout, stderr, new_path){ 78 | code.should.be.equal(0); 79 | stderr.should.be.empty; 80 | new_path.should.eql([__dirname + '/css/simple.css']); 81 | actual = read_file(path.join(__dirname, 'css/simple.css')); 82 | expected = read_file(path.join(__dirname, 'expected/simple.css')); 83 | actual.should.equal(expected); 84 | done(); 85 | }); 86 | }); 87 | 88 | it('test releate path with config.rb config', function(done) { 89 | compass(path.join(__dirname, 'sass/base/compile.scss'), { 90 | project: __dirname, 91 | config_file: path.join(__dirname, 'config.rb') 92 | }, function(code, stdout, stderr, new_path){ 93 | code.should.be.equal(0); 94 | stderr.should.be.empty; 95 | new_path.should.eql([__dirname + '/css/base/compile.css']); 96 | actual = read_file(path.join(__dirname, 'css/base/compile.css')); 97 | expected = read_file(path.join(__dirname, 'expected/compile.css')); 98 | actual.should.equal(expected); 99 | done(); 100 | }); 101 | }); 102 | 103 | it('test import_path option', function(done) { 104 | compass(path.join(__dirname, 'sass/import.scss'), { 105 | project: __dirname, 106 | style: 'compressed', 107 | import_path: 'bower_components' 108 | }, function(code, stdout, stderr, new_path){ 109 | code.should.be.equal(0); 110 | stderr.should.be.empty; 111 | new_path.should.eql([__dirname + '/css/import.css']); 112 | actual = read_file(path.join(__dirname, 'css/import.css')); 113 | expected = read_file(path.join(__dirname, 'expected/import.css')); 114 | actual.should.equal(expected); 115 | done(); 116 | }); 117 | }); 118 | 119 | it('test import_path array option', function(done) { 120 | compass(path.join(__dirname, 'sass/import2.scss'), { 121 | project: __dirname, 122 | style: 'compressed', 123 | import_path: ['bower_components', 'bower_components2'] 124 | }, function(code, stdout, stderr, new_path){ 125 | code.should.be.equal(0); 126 | stderr.should.be.empty; 127 | new_path.should.eql([__dirname + '/css/import2.css']); 128 | actual = read_file(path.join(__dirname, 'css/import2.css')); 129 | expected = read_file(path.join(__dirname, 'expected/import2.css')); 130 | actual.should.equal(expected); 131 | done(); 132 | }); 133 | }); 134 | 135 | it('test require option', function(done) { 136 | compass(path.join(__dirname, 'sass/require.scss'), { 137 | project: __dirname, 138 | style: 'compressed', 139 | require: 'susy' 140 | }, function(code, stdout, stderr, new_path){ 141 | code.should.be.equal(0); 142 | stderr.should.be.empty; 143 | new_path.should.eql([__dirname + '/css/require.css']); 144 | actual = read_file(path.join(__dirname, 'css/require.css')); 145 | expected = read_file(path.join(__dirname, 'expected/require.css')); 146 | actual.should.equal(expected); 147 | done(); 148 | }); 149 | }); 150 | 151 | it('test spriting with compass', function(done) { 152 | compass(path.join(__dirname, 'sass/spriting.scss'), { 153 | project: __dirname, 154 | style: 'compressed', 155 | css: 'css', 156 | sass: 'sass', 157 | image: 'images', 158 | relative: true 159 | }, function(code, stdout, stderr, new_path){ 160 | code.should.be.equal(0); 161 | stderr.should.be.empty; 162 | new_path.should.eql([__dirname + '/css/spriting.css']); 163 | actual = read_file(path.join(__dirname, 'css/spriting.css')); 164 | expected = read_file(path.join(__dirname, 'expected/spriting.css')); 165 | actual.should.equal(expected); 166 | done(); 167 | }); 168 | }); 169 | 170 | it('test multiple require option', function(done) { 171 | compass(path.join(__dirname, 'sass/multiple-require.scss'), { 172 | project: __dirname, 173 | style: 'compressed', 174 | require: ['susy', 'modular-scale'] 175 | }, function(code, stdout, stderr, new_path){ 176 | code.should.be.equal(0); 177 | stderr.should.be.empty; 178 | new_path.should.eql([__dirname + '/css/multiple-require.css']); 179 | actual = read_file(path.join(__dirname, 'css/multiple-require.css')); 180 | expected = read_file(path.join(__dirname, 'expected/require.css')); 181 | actual.should.equal(expected); 182 | done(); 183 | }); 184 | }); 185 | 186 | it('test environment option', function(done) { 187 | compass(path.join(__dirname, 'sass/base/compile2.scss'), { 188 | project: __dirname, 189 | config_file: path.join(__dirname, 'config.rb'), 190 | environment: 'development' 191 | }, function(code, stdout, stderr, new_path){ 192 | code.should.be.equal(0); 193 | stderr.should.be.empty; 194 | new_path.should.eql([__dirname + '/css/base/compile2.css']); 195 | actual = read_file(path.join(__dirname, 'css/base/compile2.css')); 196 | expected = read_file(path.join(__dirname, 'expected/compile2.css')); 197 | actual.should.equal(expected); 198 | done(); 199 | }); 200 | }); 201 | 202 | it('test config_file option and overwrite output style', function(done) { 203 | compass(path.join(__dirname, 'sass/base/compile3.scss'), { 204 | project: __dirname, 205 | config_file: path.join(__dirname, 'config.rb'), 206 | style: 'expanded' 207 | }, function(code, stdout, stderr, new_path){ 208 | code.should.be.equal(0); 209 | stderr.should.be.empty; 210 | new_path.should.eql([__dirname + '/css/base/compile3.css']); 211 | actual = read_file(path.join(__dirname, 'css/base/compile3.css')); 212 | expected = read_file(path.join(__dirname, 'expected/compile2.css')); 213 | actual.should.equal(expected); 214 | done(); 215 | }); 216 | }); 217 | 218 | it('should normalize ./ paths in sass and css options', function(done) { 219 | compass(path.join(__dirname, 'sass/simple.sass'), { 220 | project: __dirname, 221 | sass: './sass', 222 | css: './css', 223 | logging: true 224 | }, function(code, stdout, stderr, new_path) { 225 | code.should.be.equal(0); 226 | stderr.should.be.empty; 227 | new_path.should.eql([__dirname + '/css/simple.css']); 228 | actual = read_file(path.join(__dirname, 'css/simple.css')); 229 | expected = read_file(path.join(__dirname, 'expected/simple.css')); 230 | actual.should.equal(expected); 231 | done(); 232 | }); 233 | }); 234 | 235 | it('should allow absolute paths in sass and css options', function(done) { 236 | compass(path.join(__dirname, 'sass/simple2.sass'), { 237 | project: __dirname, 238 | sass: __dirname + '/sass', 239 | css: __dirname + '/css', 240 | logging: true 241 | }, function(code, stdout, stderr, new_path) { 242 | stderr.should.be.empty; 243 | new_path.should.eql([__dirname + '/css/simple2.css']); 244 | done(); 245 | }); 246 | }); 247 | 248 | it('import a directory’s contents', function(done) { 249 | compass(path.join(__dirname, 'sass/partial.scss'), { 250 | project: __dirname, 251 | config_file: path.join(__dirname, 'config.rb'), 252 | style: 'compressed', 253 | css: 'css', 254 | sass: 'sass', 255 | logging: false, 256 | debug: true 257 | }, function(code, stdout, stderr, new_path, options) { 258 | code.should.be.equal(0); 259 | options.debug.should.be.ok; 260 | stderr.should.be.empty; 261 | new_path.should.eql([__dirname + '/css/partial.css']); 262 | actual = read_file(path.join(__dirname, 'css/partial.css')); 263 | expected = read_file(path.join(__dirname, 'expected/partial.css')); 264 | actual.should.equal(expected); 265 | done(); 266 | }); 267 | }); 268 | 269 | it('test error content', function(done) { 270 | compass(path.join(__dirname, 'sass/error.scss'), { 271 | project: __dirname, 272 | config_file: path.join(__dirname, 'config.rb'), 273 | style: 'compressed', 274 | css: 'css', 275 | sass: 'sass', 276 | logging: true 277 | }, function(code, stdout, stderr, new_path, options) { 278 | code.should.be.equal(1); 279 | stderr.should.not.be.empty; 280 | done(); 281 | }); 282 | }); 283 | 284 | it('test bundle exec command', function(done) { 285 | compass(path.join(__dirname, 'sass/compile.scss'), { 286 | project: __dirname, 287 | style: 'compressed', 288 | css: 'css', 289 | sass: 'sass', 290 | logging: false, 291 | debug: true, 292 | bundle_exec: true 293 | }, function(code, stdout, stderr, new_path, options) { 294 | code.should.be.equal(0); 295 | options.debug.should.be.ok; 296 | stderr.should.be.empty; 297 | new_path.should.eql([__dirname + '/css/compile.css']); 298 | actual = read_file(path.join(__dirname, 'css/compile.css')); 299 | expected = read_file(path.join(__dirname, 'expected/compile.css')); 300 | actual.should.equal(expected); 301 | done(); 302 | }); 303 | }); 304 | 305 | }); 306 | 307 | describe('compass helper', function() { 308 | this.timeout(60000); 309 | it('test helper isArray', function(done) { 310 | helpers.isArray(['test']).should.be.ok; 311 | helpers.isArray('test').should.not.be.ok; 312 | done(); 313 | }); 314 | 315 | it('test helper command', function(done) { 316 | helpers.command('compass').should.not.be.empty; 317 | helpers.command('compass_test').should.not.be.ok; 318 | helpers.command('compass_test', function(code, stdout, stderr, new_path) { 319 | code.should.equal(127); 320 | stdout.should.be.empty; 321 | stderr.should.not.be.empty; 322 | new_path.should.be.empty; 323 | }); 324 | done(); 325 | }); 326 | }); 327 | }); 328 | -------------------------------------------------------------------------------- /test/config.rb: -------------------------------------------------------------------------------- 1 | require 'sass-globbing' 2 | 3 | # Require any additional compass plugins here. 4 | 5 | # Set this to the root of your project when deployed: 6 | http_path = "/" 7 | css_dir = "css" 8 | sass_dir = "sass" 9 | 10 | # You can select your preferred output style here (can be overridden via the command line): 11 | # output_style = :expanded or :nested or :compact or :compressed 12 | output_style = (environment == :development) ? :expanded : :compressed 13 | 14 | # To enable relative paths to assets via compass helper functions. Uncomment: 15 | relative_assets = true 16 | 17 | # To disable debugging comments that display the original location of your selectors. Uncomment: 18 | line_comments = false 19 | 20 | # If you prefer the indented syntax, you might want to regenerate this 21 | # project again passing --syntax sass, or you can uncomment this: 22 | # preferred_syntax = :sass 23 | # and then run: 24 | # sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass 25 | -------------------------------------------------------------------------------- /test/expected/compile.css: -------------------------------------------------------------------------------- 1 | html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font:inherit;font-size:100%;vertical-align:baseline}html{line-height:1}ol,ul{list-style:none}table{border-collapse:collapse;border-spacing:0}caption,th,td{text-align:left;font-weight:normal;vertical-align:middle}q,blockquote{quotes:none}q:before,q:after,blockquote:before,blockquote:after{content:"";content:none}a img{border:none}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}li{font-family:serif;font-weight:bold;font-size:1.2em}.content-navigation{border-color:#3bbfce;color:#2ca2af}.border{padding:8px;margin:8px;border-color:#3bbfce} 2 | -------------------------------------------------------------------------------- /test/expected/compile2.css: -------------------------------------------------------------------------------- 1 | html, body, div, span, applet, object, iframe, 2 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 3 | a, abbr, acronym, address, big, cite, code, 4 | del, dfn, em, img, ins, kbd, q, s, samp, 5 | small, strike, strong, sub, sup, tt, var, 6 | b, u, i, center, 7 | dl, dt, dd, ol, ul, li, 8 | fieldset, form, label, legend, 9 | table, caption, tbody, tfoot, thead, tr, th, td, 10 | article, aside, canvas, details, embed, 11 | figure, figcaption, footer, header, hgroup, 12 | menu, nav, output, ruby, section, summary, 13 | time, mark, audio, video { 14 | margin: 0; 15 | padding: 0; 16 | border: 0; 17 | font: inherit; 18 | font-size: 100%; 19 | vertical-align: baseline; 20 | } 21 | 22 | html { 23 | line-height: 1; 24 | } 25 | 26 | ol, ul { 27 | list-style: none; 28 | } 29 | 30 | table { 31 | border-collapse: collapse; 32 | border-spacing: 0; 33 | } 34 | 35 | caption, th, td { 36 | text-align: left; 37 | font-weight: normal; 38 | vertical-align: middle; 39 | } 40 | 41 | q, blockquote { 42 | quotes: none; 43 | } 44 | q:before, q:after, blockquote:before, blockquote:after { 45 | content: ""; 46 | content: none; 47 | } 48 | 49 | a img { 50 | border: none; 51 | } 52 | 53 | article, aside, details, figcaption, figure, footer, header, hgroup, main, menu, nav, section, summary { 54 | display: block; 55 | } 56 | 57 | li { 58 | font-family: serif; 59 | font-weight: bold; 60 | font-size: 1.2em; 61 | } 62 | 63 | .content-navigation { 64 | border-color: #3bbfce; 65 | color: #2ca2af; 66 | } 67 | 68 | .border { 69 | padding: 8px; 70 | margin: 8px; 71 | border-color: #3bbfce; 72 | } 73 | -------------------------------------------------------------------------------- /test/expected/import.css: -------------------------------------------------------------------------------- 1 | html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font:inherit;font-size:100%;vertical-align:baseline}html{line-height:1}ol,ul{list-style:none}table{border-collapse:collapse;border-spacing:0}caption,th,td{text-align:left;font-weight:normal;vertical-align:middle}q,blockquote{quotes:none}q:before,q:after,blockquote:before,blockquote:after{content:"";content:none}a img{border:none}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}body{color:#333} 2 | -------------------------------------------------------------------------------- /test/expected/import2.css: -------------------------------------------------------------------------------- 1 | html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font:inherit;font-size:100%;vertical-align:baseline}html{line-height:1}ol,ul{list-style:none}table{border-collapse:collapse;border-spacing:0}caption,th,td{text-align:left;font-weight:normal;vertical-align:middle}q,blockquote{quotes:none}q:before,q:after,blockquote:before,blockquote:after{content:"";content:none}a img{border:none}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}body{color:#333}.footer{color:#ccc} 2 | -------------------------------------------------------------------------------- /test/expected/partial.css: -------------------------------------------------------------------------------- 1 | .a{color:#fff}.b{color:#000} 2 | -------------------------------------------------------------------------------- /test/expected/require.css: -------------------------------------------------------------------------------- 1 | .page{max-width:100%;margin-left:auto;margin-right:auto}.page:after{content:" ";display:block;clear:both} 2 | -------------------------------------------------------------------------------- /test/expected/simple.css: -------------------------------------------------------------------------------- 1 | .element{color:red} 2 | -------------------------------------------------------------------------------- /test/expected/spriting.css: -------------------------------------------------------------------------------- 1 | .my-icons-sprite,.my-icons-edit,.my-icons-new{background-image:url('../images/my-icons-s73a5d512e7.png');background-repeat:no-repeat}.my-icons-edit{background-position:0 0}.my-icons-new{background-position:0 -128px} 2 | -------------------------------------------------------------------------------- /test/images/my-icons/edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/appleboy/gulp-compass/734f9d902590627f499df9d1487c65ff627c238b/test/images/my-icons/edit.png -------------------------------------------------------------------------------- /test/images/my-icons/new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/appleboy/gulp-compass/734f9d902590627f499df9d1487c65ff627c238b/test/images/my-icons/new.png -------------------------------------------------------------------------------- /test/sass/_imported.scss: -------------------------------------------------------------------------------- 1 | li { 2 | font: { 3 | family: serif; 4 | weight: bold; 5 | size: 1.2em; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /test/sass/base/compile.scss: -------------------------------------------------------------------------------- 1 | @import 'compass/reset'; 2 | @import 'imported'; 3 | 4 | $blue: #3bbfce; 5 | $margin: 16px; 6 | 7 | .content-navigation { 8 | border-color: $blue; 9 | color: 10 | darken($blue, 9%); 11 | } 12 | 13 | .border { 14 | padding: $margin / 2; 15 | margin: $margin / 2; 16 | border-color: $blue; 17 | } 18 | -------------------------------------------------------------------------------- /test/sass/base/compile2.scss: -------------------------------------------------------------------------------- 1 | @import 'compass/reset'; 2 | @import 'imported'; 3 | 4 | $blue: #3bbfce; 5 | $margin: 16px; 6 | 7 | .content-navigation { 8 | border-color: $blue; 9 | color: 10 | darken($blue, 9%); 11 | } 12 | 13 | .border { 14 | padding: $margin / 2; 15 | margin: $margin / 2; 16 | border-color: $blue; 17 | } 18 | -------------------------------------------------------------------------------- /test/sass/base/compile3.scss: -------------------------------------------------------------------------------- 1 | @import 'compass/reset'; 2 | @import 'imported'; 3 | 4 | $blue: #3bbfce; 5 | $margin: 16px; 6 | 7 | .content-navigation { 8 | border-color: $blue; 9 | color: 10 | darken($blue, 9%); 11 | } 12 | 13 | .border { 14 | padding: $margin / 2; 15 | margin: $margin / 2; 16 | border-color: $blue; 17 | } 18 | -------------------------------------------------------------------------------- /test/sass/compile.scss: -------------------------------------------------------------------------------- 1 | @import 'compass/reset'; 2 | @import 'imported'; 3 | 4 | $blue: #3bbfce; 5 | $margin: 16px; 6 | 7 | .content-navigation { 8 | border-color: $blue; 9 | color: 10 | darken($blue, 9%); 11 | } 12 | 13 | .border { 14 | padding: $margin / 2; 15 | margin: $margin / 2; 16 | border-color: $blue; 17 | } 18 | -------------------------------------------------------------------------------- /test/sass/error.scss: -------------------------------------------------------------------------------- 1 | .error: 2 | color: #ccc 3 | -------------------------------------------------------------------------------- /test/sass/import.scss: -------------------------------------------------------------------------------- 1 | @import "base"; 2 | -------------------------------------------------------------------------------- /test/sass/import2.scss: -------------------------------------------------------------------------------- 1 | @import "base"; 2 | @import "base2"; 3 | -------------------------------------------------------------------------------- /test/sass/multiple-require.scss: -------------------------------------------------------------------------------- 1 | @import "susy"; 2 | @import "modular-scale"; 3 | 4 | .page { 5 | @include container; 6 | } 7 | -------------------------------------------------------------------------------- /test/sass/partial.scss: -------------------------------------------------------------------------------- 1 | @import "partial/*"; 2 | -------------------------------------------------------------------------------- /test/sass/partial/_base_1.scss: -------------------------------------------------------------------------------- 1 | .a { 2 | color: #fff; 3 | } 4 | -------------------------------------------------------------------------------- /test/sass/partial/_base_2.scss: -------------------------------------------------------------------------------- 1 | .b { 2 | color: #000; 3 | } 4 | -------------------------------------------------------------------------------- /test/sass/require.scss: -------------------------------------------------------------------------------- 1 | @import "susy"; 2 | 3 | .page { 4 | @include container; 5 | } 6 | -------------------------------------------------------------------------------- /test/sass/simple.sass: -------------------------------------------------------------------------------- 1 | .element 2 | color: red 3 | -------------------------------------------------------------------------------- /test/sass/simple2.sass: -------------------------------------------------------------------------------- 1 | .element 2 | color: red 3 | -------------------------------------------------------------------------------- /test/sass/spriting.scss: -------------------------------------------------------------------------------- 1 | @import "compass/utilities/sprites"; 2 | @import "my-icons/*.png"; 3 | @include all-my-icons-sprites; 4 | --------------------------------------------------------------------------------