BLUE
PHP 7.4.33
Path:
/var/www/podio.norlys.foo/httpdocs/node_modules/css-tree
Run
Logout
Edit File
Size: 4.45 KB
Close
/var/www/podio.norlys.foo/httpdocs/node_modules/css-tree/README.md
Text
Base64
<img align="right" width="111" height="111" alt="CSSTree logo" src="https://cloud.githubusercontent.com/assets/270491/19243723/6f9136c6-8f21-11e6-82ac-eeeee4c6c452.png"/> # CSSTree [](https://www.npmjs.com/package/css-tree) [](https://travis-ci.org/csstree/csstree) [](https://coveralls.io/github/csstree/csstree?branch=master) [](https://gitter.im/csstree/csstree) [](https://twitter.com/csstree) CSSTree is a tool set to work with CSS, including [fast](https://github.com/postcss/benchmark) detailed parser (string->AST), walker (AST traversal), generator (AST->string) and lexer (validation and matching) based on knowledge of spec and browser implementations. The main goal is to be efficient and W3C spec compliant, with focus on CSS analyzing and source-to-source transforming tasks. > NOTE: The project is in alpha stage since some parts need further improvements, AST format and API are subjects to change. However it's stable enough and used by packages like [CSSO](https://github.com/css/csso) (CSS minifier) and [SVGO](https://github.com/svg/svgo) (SVG optimizer) in production. ## Features - **Detailed parsing with an adjustable level of detail** By default CSSTree parses CSS as detailed as possible, i.e. each single logical part is representing with its own AST node (see [AST format](docs/ast.md) for all possible node types). The parsing detail level can be changed through [parser options](docs/parsing.md#parsesource-options), for example, you can disable parsing of selectors or declarations for component parts. - **Tolerant to errors by design** Parser behaves as [spec says](https://www.w3.org/TR/css-syntax-3/#error-handling): "When errors occur in CSS, the parser attempts to recover gracefully, throwing away only the minimum amount of content before returning to parsing as normal". The only thing the parser departs from the specification is that it doesn't throw away bad content, but wraps it in the special nodes, which allows processing it later. - **Fast and efficient** CSSTree is created with focus on performance and effective memory consumption. Therefore it's [one of the fastest CSS parsers](https://github.com/postcss/benchmark) at the moment. - **Syntax validation** The build-in lexer can test CSS against syntaxes defined by W3C. CSSTree uses [mdn/data](https://github.com/mdn/data/) as a basis for lexer's dictionaries and extends them with vendor specific and legacy syntaxes. Lexer can only check the declaration values currently, but this feature will be extended to other parts of the CSS in the future. ## Docs - [Parsing CSS into AST](docs/parsing.md) - [AST format](docs/ast.md) - [Generate CSS from AST](docs/generate.md) - [AST traversal](docs/traversal.md) - [Utils to work with AST](docs/utils.md) ## Tools * [AST Explorer](https://astexplorer.net/#/gist/244e2fb4da940df52bf0f4b94277db44/e79aff44611020b22cfd9708f3a99ce09b7d67a8) – explore CSSTree AST format with zero setup * [CSS syntax reference](https://csstree.github.io/docs/syntax.html) * [CSS syntax validator](https://csstree.github.io/docs/validator.html) ## Related projects * [csstree-validator](https://github.com/csstree/validator) – NPM package to validate CSS * [stylelint-csstree-validator](https://github.com/csstree/stylelint-validator) – plugin for stylelint to validate CSS * [Grunt plugin](https://github.com/sergejmueller/grunt-csstree-validator) * [Gulp plugin](https://github.com/csstree/gulp-csstree) * [Sublime plugin](https://github.com/csstree/SublimeLinter-contrib-csstree) * [VS Code plugin](https://github.com/csstree/vscode-plugin) * [Atom plugin](https://github.com/csstree/atom-plugin) ## Usage Install with npm: ``` > npm install css-tree ``` Use in your code: ```js var csstree = require('css-tree'); var ast = csstree.parse('.example { world: "!" }'); csstree.walk(ast, function(node) { if (node.type === 'ClassSelector' && node.name === 'example') { node.name = 'hello'; } }); console.log(csstree.generate(ast)); // .hello{world:"!"} ``` ## Top level API  ## License MIT
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 5 × Files: 4
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
data
DIR
-
drwxr-xr-x
2019-03-29 05:48:42
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
dist
DIR
-
drwxr-xr-x
2019-03-29 05:48:42
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
docs
DIR
-
drwxr-xr-x
2019-03-29 05:48:42
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
lib
DIR
-
drwxr-xr-x
2019-03-29 05:48:42
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
node_modules
DIR
-
drwxr-xr-x
2019-03-29 05:48:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
HISTORY.md
26.58 KB
lrw-r--r--
2018-11-14 11:25:00
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
LICENSE
1.04 KB
lrw-r--r--
2018-11-14 11:25:00
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
package.json
2.66 KB
lrw-r--r--
2018-11-14 11:25:00
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
README.md
4.45 KB
lrw-r--r--
2018-11-14 11:25:00
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).