How to use the sass.js.options function in sass

To help you get started, we’ve selected a few sass examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github amiramw / grunt-contrib-sassjs / tasks / sass.js View on Github external
grunt.registerMultiTask('sass', 'Compile Sass to CSS', function () {
		var files = this.files, data = this.data, done = this.async();

		Sass.options(this.options());

		Q.all(files.map(function (file) {
			var deferred = Q.defer();
			var src = file.src[0];
			Sass.writeFile(src, grunt.file.read(src));
			if (PATH.basename(src)[0] !== '_') {
				Sass.compileFile(src, function (result) {
					if  (result.status !== 0) {
						grunt.log.error(result.formatted + '\n');
						grunt.warn('');
						deferred.reject();
					} else {
						try {
							var cssFullPath = file.dest;
							var content = result.text;
							if (data.sourceMap && result.map) {
github amiramw / grunt-contrib-sassjs / tasks / sass.js View on Github external
'use strict';

var Sass = require('sass.js');
var Q = require('q');
var PATH = require('path');

Sass.options({
	style: Sass.style.expanded
});
module.exports = function (grunt) {
	Sass.importer(function (request, done) {
		if (request.path) {
			done();
		} else if (request.resolved) {
			var realPath = request.resolved.replace(/^\/sass\//, "");
			done(Sass.getPathVariations(realPath).reduce(function (found, path) {
				if (found) {
					return found;
				}
				if (grunt.file.exists(path) && !grunt.file.isDir(path)) {
					return {
						path: request.resolved.substr(0, request.resolved.lastIndexOf('/') + 1) + PATH.basename(path),
						content: grunt.file.read(path)