/grunt-sass

Compile Sass to CSS

Primary LanguageJavaScriptMIT LicenseMIT

grunt-sass Build Status

Compile Sass to CSS using node-sass

Forked from sindresorhus/grunt-sass to add some tweaks that I needed. See commit history for details.

This task uses libsass, which is a Sass compiler in C++. It's a lot faster than the original Ruby compiler and fully compatible.

Install

$ npm install --save-dev grunt-sass
$ yarn add --dev grunt-sass

Usage

require('load-grunt-tasks')(grunt); // npm install --save-dev load-grunt-tasks

grunt.initConfig({
    sass: {
        options: {
            sourceMap: true
        },
        dist: {
            files: {
                'main.css': 'main.scss'
            }
        }
    }
});

grunt.registerTask('default', ['sass']);

Files starting with _ are ignored to match the expected Sass partial behaviour.

Options

See the node-sass options, except for file, outFile, success, error.

The default value for the precision option is 10, so you don't have to change it when using Bootstrap.

License

MIT © Sindre Sorhus