Skip to content

Simple importer for node-sass to allow importing Sass files using glob patterns

License

Notifications You must be signed in to change notification settings

lucasmotta/sass-glob-importer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sass-glob-importer

Simple importer for node-sass to allow importing Sass files using glob patterns

@import "settings/*.scss";
@import "components/*.scss";

The files will always be sorted alphabetically when imported.

How-to

install

npm install sass-glob-importer --save-dev

use the importer with node-sass >= v3.0.0

var sass = require('node-sass');
var globImporter = require('sass-glob-importer');

sass.render({
  file: './source/css/app.scss',
  importer: globImporter()
}, cb);

use the importer with gulp-sass

var gulp = require('gulp');
var sass = require('gulp-sass');
var globImporter = require('sass-glob-importer');

gulp.task('style', function() {
  return gulp.src('./source/css/app.scss')
    .pipe(sass({ importer: globImporter() }))
    .pipe(gulp.dest('./public/css'));
});

Tests

Use npm test to run the tests.

Issues

If you discover a bug, please raise an issue on Github. https://github.com/lucasmotta/sass-glob-importer/issues

Contributors

The source code and the test are written in ES6 (ECMAScript 2015).
Babel is being used to compile to ES5 before the package is published to npm.

About

Simple importer for node-sass to allow importing Sass files using glob patterns

Resources

License

Stars

Watchers

Forks

Packages

No packages published