Add Root node to API.md

This commit is contained in:
Andrey Sitnik
2015-02-11 13:29:45 +03:00
parent 634cf04da8
commit c8afe3ce01
+19
View File
@@ -710,3 +710,22 @@ Removes all children from contain and clean their `parent` properties.
rule.removeAll();
rule.nodes.length //=> 0
```
## `Root` node
Represents CSS file and contain all nodes inside.
```js
var root = postcss.parse('a{color:black} b{z-index:2}');
root.type //=> 'root'
root.nodes.length //=> 2
```
#### `after`
Stores space symbols after last child like `\n` from end of the file.
```js
var root = parse('a {}\nb { color: black }\n');
root.after //=> '\n'
```