js-to-sass-types
v0.0.2
Published
Convert JavaScript types to node-sass types
Downloads
1
Readme
js-to-sass-types
Convert JavaScript types to node-sass types.
Installation
$ npm install --save js-to-sass-types
Usage
sass-config.json
{
"colors": {
"text": "#fff"
}
}
style.scss
$config: getconfig();
$colors: map-get($config, "colors");
$color-text: map-get($colors, "text");
body {
color: $color-text;
}
var sass = require('node-sass');
var convert = require('js-to-sass-types').convert;
var config = convert(require('./sass-config.json'));
var res = sass.renderSync({
file: './style.scss',
functions: {
'getconfig()': function () {
return config;
}
}
});
console.log(res.css.toString());
License
MIT © Luka Zakrajšek