Permalink
Browse files

Docs: fix usage examples

  • Loading branch information...
1 parent e2ae3b3 commit 9d771b8767e763b50854820979df7ee1eeb09eac @MoOx committed Nov 28, 2016
Showing with 25 additions and 13 deletions.
  1. +25 −13 docs/content/usage.md
View
@@ -37,28 +37,40 @@ _Features are enabled by default: no key means feature is enabled_. Keys can be
```js
//eg: disable custom properties support
-var output = cssnext(input, {
- features: {
- customProperties: false
- }
-})
+
+var postcss = require("postcss")
+var cssnext = require("postcss-cssnext")
+
+postcss([
+ cssnext({
+ features: {
+ customProperties: false
+ }
+ })
+])
```
Each feature is based on PostCSS plugins & can get its own options.
To pass options to a feature, you can just pass an object to the feature:
```js
//eg: pass variables
-var output = cssnext(input, {
- features: {
- customProperties: {
- variables: {
- mainColor: "red",
- altColor: "blue",
+
+var postcss = require("postcss")
+var cssnext = require("postcss-cssnext")
+
+postcss([
+ cssnext({
+ features: {
+ customProperties: {
+ variables: {
+ mainColor: "red",
+ altColor: "blue",
+ }
}
}
- }
-})
+ })
+])
```
## `warnForDuplicates`

0 comments on commit 9d771b8

Please sign in to comment.