css-treeify
v0.2.0
Published
Parse the structure of CSS to an object tree.
Downloads
12
Maintainers
Readme
CSS Treeify 
Parse the structure of CSS to an object tree.
Install
npm install css-treeifyUsage
const cssTreeify = require("css-treeify");
cssTreeify(`
body { font-size: 10px; }
html { font-size: 11px; }
html, body { font-size: 12px; }
@media only screen and (max-width: 600px) {
body {
background-color: lightblue;
}
html {
background-color: grey;
}
}
`);
/* {
'@media only screen and (max-width: 600px)': {
body: {
'background-color': 'lightblue'
},
html: {
'background-color': 'grey'
}
},
body: {
'font-size': '12px'
},
html: {
'font-size': '12px'
}
}
*/API
cssTreeify(css)
css
Type: string
The CSS to parse.

