json2sass

0.2.0 • Public • Published

json2sass

Generate SASS/SCSS vars files out of a JSON

It turns this:

{
    "/*": "This is a special comment",
    "button": {
        "//": "This is a simple comment",
        "color": "green",
        "padding": "10px",
        "font": {
            "family": "'Helvetica Arial sans-serif'",
            "color": "white"
        }
    }
}

Into this:

/**
 * This is a special comment
 */
 
// This is a simple comment
$button-color: green
$button-padding: 10px
$button-font-family: 'Helvetica Arial sans-serif'
$button-font-color: white

dependencies

  • Nodejs

usage

Using as a module:

var json2sass = require('json2sass');
json2sass.toSass('path/to/existing.json', 'path/to/created.sass');
json2sass.toScss('path/to/existing.json', 'path/to/created.scss');

Or by cloning the repo:

node . --input path/to/existing.json --output path/to/created.sass
node . --input path/to/existing.json --output path/to/created.scss --type scss

Readme

Keywords

Package Sidebar

Install

npm i json2sass

Weekly Downloads

3

Version

0.2.0

License

none

Last publish

Collaborators

  • renancouto