https://github.com/sha-red/compass-mixins/tree/master/lib
extended with more sass frameworks and as django app.
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
615 B
20 lines
615 B
var sass = require('node-sass'); |
|
var libDir = __dirname.replace(/test\/helper$/, 'lib'); |
|
var chalk = require('chalk'); |
|
|
|
module.exports = function(data, callback, imports) { |
|
imports = imports ? imports.map(function(i){ return '@import "'+libDir+'/'+i+'";'}) : []; |
|
|
|
sass.render({ |
|
data: '@import "'+libDir+'/compass/functions";' + imports.join('') + data, |
|
outputStyle: 'compressed', |
|
includePaths: [__dirname], |
|
}, function(err, output) { |
|
if (err) { |
|
console.log(chalk.red("Sass error:"), err); |
|
callback('', err); |
|
} else { |
|
callback(output.css.toString().trim()); |
|
} |
|
}); |
|
}
|
|
|