@ando105/ast-css-iterdeprecated

A simple API for iteration on CSS abstract tree

Usage no npm install needed!

<script type="module">
  import ando105AstCssIter from 'https://cdn.skypack.dev/@ando105/ast-css-iter';
</script>

README

:vietnam: Abstract Syntax Tree extractor

Build status

Methods

Stylesheet level

- getAllRules
- backwardRulesTracer
- addRule
- addDeclaration
- removeRule
- getImports
- getAllDeclarations
- getAllDeclarationsBySelector
- getAllDeclarationsByProperty
- getAllDeclarationsByValue

Rule level

- findDeclarations
- findDeclarationsBySelector
- findDeclarationsByProperty
- findDeclarationsByValue
- getAllRulesBySelector
- getAllRulesByType

Declaration level

- addDeclaration
- removeDeclaration
- getParam
- getAllParams

How to install

$ npm i @ando105/ast-css-iter --save-dev

Example :cherry_blossom: :fire:

const css = require('css')
const astIter = require('@ando105/ast-css-iter')

Development

Code Style

To be updated

Validate the code style with ESLint:

$ npm i eslint --save-dev
$ npm run eslint

Tests

Run the unit tests with mocha:

$ npm run test

Release

See Releases to see my detailed changelog.

License

License: MIT