node_modules

This commit is contained in:
saeid
2019-07-15 13:07:31 +04:30
parent d3735c6d30
commit ce1a3ebf9c
35713 changed files with 3639219 additions and 1 deletions
+48
View File
@@ -0,0 +1,48 @@
# Translate AST to string
## generate(ast[, options])
Generates a CSS string for given AST.
```js
// generate with default settings
csstree.generate(ast);
// generate with options
csstree.generate(ast, {
sourceMap: true
});
```
Options (optional):
<!-- MarkdownTOC -->
- [sourceMap](#sourcemap)
- [decorator](#decorator)
<!-- /MarkdownTOC -->
### sourceMap
Type: `boolean`
Default: `false`
Generates a source map (nodes should contain positions in `loc` property). Note, that an object instead of string is returned in that case.
```js
var ast = csstree.parse('.test { color: red }', {
filename: 'my.css',
positions: true
});
var result = csstree.generate(ast, { sourceMap: true });
// { css: '.test{color:red}', map: SourceMapGenerator {} }
```
### decorator
Type: `function`
Default: none
A function that a handlers used by a generator. TBD