@dev-toolbox/css-json
v1.0.9
Published
@dev-toolbox/css-json package is created for the developers to parse the CSS and get the structured data in multiple helpful formats. In Simple Terms this package Parse JSON from CSS string and it can transform the generated JSON to string CSS.
Downloads
48
Maintainers
Readme
Install
npm i @dev-toolbox/css-json
Import
import { CssJson } from '@dev-toolbox/css-json';
Usage
const cssString = '.test{color:red;}';
const options = {}; const parser = new CssJson(CssString,options);
const output = parser.parse();
console.log('output', output);
Available Options
const defaultOptions: ICssJsonOptions = { resultType: CssJsonResultType.ADVANCED, seperateMultiSelectorStyles: false, //will omit this if resultType===CssJsonResultType.ADVANCED, keyValueAttributes: false, //will omit this if resultType===CssJsonResultType.ADVANCED, };