json-to-scss
json-to-scss copied to clipboard
Added a `keysAsVars`/`--kv` option to allow output without a wrapping object
So, with the following JSON input.json
:
{
"foo": "bar",
"baz": ["qux", "quux", "quuz"],
"corge": {
"grault": "garply",
"waldo": "fred"
}
}
And running json-to-scss input.json --kv
, you would get:
$foo: bar;
$baz: (qux, quux, quuz);
$corge: (
grault: garply,
waldo: fred
);
And not:
$input: (
foo: bar,
baz: (qux, quux, quuz),
corge: (
grault: garply,
waldo: fred
)
);
Why?
It matches the naming of objects when using the glob mode, only from a single file. The flatten keys
option totally flattens - where as this new option only removes the wrapping object.
It also happens to suit the input I wanted for @area17/scss-utilities 😉
bump @rlapoele