Grunt task to compile SASS and SCSS
JavaScript
Pull request Compare This branch is 3 commits ahead, 135 commits behind sindresorhus:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin
docs
tasks
test/fixtures
.editorconfig
.gitignore
.jshintignore
.jshintrc
.npmignore
Gruntfile.js
package.json
readme.md

readme.md

grunt-sass

Grunt tasks to compile SASS:

sass task

Uses the experimental and superfast Node.js based SASS compiler, node-sass, which uses libsass. This task only compiles .scss files.

Note that node-sass is currently under heavy development and might be unstable, there are also some stuff missing, like compression options and file/folder context, which means you need to specify @import using the relative path from your Gruntfile. You also need to include the extension

rubysass task

Uses the official Ruby based SASS compiler, which is stable, but also slow and has a Ruby dependency. Currently the recommended one to use in production. It also supports the old Sass syntax (.sass).

Getting started

Install this grunt plugin next to your project's Gruntfile with: npm install grunt-sass

Then add this line to your project's Gruntfile:

grunt.loadNpmTasks('grunt-sass');

And add the tasks you want to grunt.registerTask:

grunt.registerTask('default', 'lint sass');
// or `rubysass`
// grunt.registerTask('default', 'lint rubysass');

Documentation

Tests

Grunt currently doesn't have a way to test tasks directly. You can test this task by running grunt and manually verify that it works.

Contribute

In lieu of a formal styleguide, take care to maintain the existing coding style.

License

MIT License (c) Sindre Sorhus