Skip to content
This repository was archived by the owner on Dec 19, 2024. It is now read-only.

Commit 9d771b8

Browse files
committed
Docs: fix usage examples
1 parent e2ae3b3 commit 9d771b8

File tree

1 file changed

+25
-13
lines changed

1 file changed

+25
-13
lines changed

docs/content/usage.md

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,28 +37,40 @@ _Features are enabled by default: no key means feature is enabled_. Keys can be
3737

3838
```js
3939
//eg: disable custom properties support
40-
var output = cssnext(input, {
41-
features: {
42-
customProperties: false
43-
}
44-
})
40+
41+
var postcss = require("postcss")
42+
var cssnext = require("postcss-cssnext")
43+
44+
postcss([
45+
cssnext({
46+
features: {
47+
customProperties: false
48+
}
49+
})
50+
])
4551
```
4652

4753
Each feature is based on PostCSS plugins & can get its own options.
4854
To pass options to a feature, you can just pass an object to the feature:
4955

5056
```js
5157
//eg: pass variables
52-
var output = cssnext(input, {
53-
features: {
54-
customProperties: {
55-
variables: {
56-
mainColor: "red",
57-
altColor: "blue",
58+
59+
var postcss = require("postcss")
60+
var cssnext = require("postcss-cssnext")
61+
62+
postcss([
63+
cssnext({
64+
features: {
65+
customProperties: {
66+
variables: {
67+
mainColor: "red",
68+
altColor: "blue",
69+
}
5870
}
5971
}
60-
}
61-
})
72+
})
73+
])
6274
```
6375

6476
## `warnForDuplicates`

0 commit comments

Comments
 (0)