0.0.2 • Published 7 years ago

js-to-sass-types v0.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

js-to-sass-types npm version

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

0.0.2

7 years ago

0.0.1

7 years ago