@scaratech/koaku
v1.0.1
Published
CSS parsing library that does CSS <-> JSON
Downloads
6
Readme
Koaku
A CSS parsing library written in TS that converts CSS to JSON and vise versa
Usage
import { parse, generate } from '@scaratech/koaku'; // npm i @scaratech/koaku
const css =
`h1 {
color: red;
}
body {
background-color: black;
}`;
// Convert CSS -> JSON
let cssJson = parse(css);
// Modify the CSS via JSON
cssJson.body['background-color'] = 'red';
// Covert JSON -> CSS
generate(cssJson);