Giter Club home page Giter Club logo

grunt-sass's Introduction

grunt-sass Build Status

Compile Sass to CSS using Dart Sass or Node Sass.

Before filing an issue with this repository, please consider:

  • Asking support questions on Use Stack Overflow.

  • Reporting issues with the output on the Dart Sass or LibSass issue trackers, depending which implementation you're using.

  • Reporting installation issues on the Dart Sass or Node Sass issue trackers, depending on which implementation you're using.

Install

$ npm install --save-dev node-sass grunt-sass

Usage

const sass = require('node-sass');

require('load-grunt-tasks')(grunt);

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

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

You can choose whether to use Dart Sass or Node Sass by passing the module to the implementation option. One implementation or the other must be passed.

Note that when using Dart Sass, synchronous compilation is twice as fast as asynchronous compilation by default, due to the overhead of asynchronous callbacks. To avoid this overhead, you can use the fibers package to call asynchronous importers from the synchronous code path. To enable this, pass the Fiber class to the fiber option:

const Fiber = require('fibers');
const sass = require('node-sass');

require('load-grunt-tasks')(grunt);

grunt.initConfig({
	sass: {
		options: {
			implementation: sass,
			fiber: Fiber,
			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.

grunt-sass's People

Contributors

sindresorhus avatar xzyfer avatar kevva avatar ntwb avatar jasisk avatar toptalo avatar swist avatar gribelu avatar corkupine avatar tcoopman avatar tleruitte avatar justafish avatar robloach avatar nschonni avatar nex3 avatar micha149 avatar karlhorky avatar kfiku avatar chrisirhc avatar benmoss avatar bengosney avatar andrew avatar am11 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.