@filbert-js/css-ast

0.0.8 • Public • Published

@filbert-js/css-ast

CSS to AST transformer for filbert-js.

Install

yarn add @filbert-js/css-ast
import { toAST } from '@filbert-js/css-ast';

const css = `
color: gray;
button {
    margin: 0 1rem;
    background: #1f368f;
    color: white;
    span {
        color: red;
    }
}
button,span {
    color: pink;
}
`;
const ast = toAST(css);
console.log(ast);
/**  
children: Array[2]
    0: Node
    1: Node
rules: Array[1]
    0: Object
name: "color"
value: "gray"
start: 0
end: 168
raw: "
  color: gray;
  button {
    margin: 0 1rem;
    background: #1f368f;
    color: white;
    span {
      color: red;
    }
  }
  button,
  span {
    color: pink;
  }
"
* */

More documentation is available at https://filbert-js.vercel.app.

Package Sidebar

Install

npm i @filbert-js/css-ast

Weekly Downloads

3

Version

0.0.8

License

MIT

Unpacked Size

8.8 kB

Total Files

9

Last publish

Collaborators

  • kuldeepkeshwar