Skip to content

Commit

Permalink
Docs: fix usage examples
Browse files Browse the repository at this point in the history
  • Loading branch information
MoOx committed Nov 28, 2016
1 parent e2ae3b3 commit 9d771b8
Showing 1 changed file with 25 additions and 13 deletions.
38 changes: 25 additions & 13 deletions docs/content/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down

0 comments on commit 9d771b8

Please sign in to comment.