Convert a JSON to a SCSS map
$ npm install @absolunet/json-to-scss
const jsonToScss = require('@absolunet/json-to-scss');
console.log(
jsonToScss.convert(`
{
"points": [
[0, 1.2],
[50, 1.6],
[200, 1.8]
],
"dimension": {
"small": 600,
"medium": 900,
"large": 1200,
"xlarge": 1500
},
"transition": {
"hover": 100,
"animation": 500
},
"color": {
"shell": {
"main": "#659d32",
"shade": "#618931"
},
"fruit": "#423228"
}
}
`)
);
/*
$points: (
0 1.2,
50 1.6,
200 1.8
);
$dimension: (
'small': 600,
'medium': 900,
'large': 1200,
'xlarge': 1500
);
$transition: (
'hover': 100,
'animation': 500
);
$color: (
'shell': (
'main': #659d32,
'shade': #618931
),
'fruit': #423228
);
*/
Converts JSON to SCSS map
Return String
SCSS
Required
Type: String
JSON content
Type: String
Default: <tab>
Indent style
Forked from razwan/json-to-sass-map
MIT © Absolunet