@@ -49,11 +49,14 @@ Each feature is based on PostCSS plugins & can get its own options.
4949To pass options to a feature, you can just pass an object to the feature:
5050
5151``` js
52- // eg: preserve custom properties
52+ // eg: pass variables
5353var output = cssnext (input, {
5454 features: {
5555 customProperties: {
56- preserve: true
56+ variables: {
57+ mainColor: " red" ,
58+ altColor: " blue" ,
59+ }
5760 }
5861 }
5962})
@@ -107,12 +110,19 @@ _(default: `true`)_
107110Allows you to inline local ` @import ` files
108111(thanks to [ postcss-import] ( https://github.com/postcss/postcss-import#readme ) ):
109112
110- * you can refer to ` node_modules ` and ` web_modules ` packages
111- * you can omit .css extension
113+ * you can refer to
114+ * ` node_modules ` packages
115+ * ` web_modules ` packages
116+ * ` bower_components ` packages
117+ * local packages or files
118+ * for packages, this will automatically
119+ * look for ` "style" ` entry in ` package.json `
120+ * or will try to call ` index.css `
121+ * you can omit ` .css ` extension of filename
112122
113123_ Note: you can pass
114124[ postcss-import options] ( https://github.com/postcss/postcss-import#readme )
115- directly._
125+ directly if needed ._
116126
117127## ` url `
118128
@@ -127,19 +137,19 @@ directly in order to inline or have more control over urls._
127137
128138## ` plugins `
129139
130- _ (default: undefined )_
140+ _ (default: ` [] ` )_
131141
132142Allows you to pass your own array of transformations. You can just pass your own
133143[ PostCSS] ( https://github.com/postcss/postcss ) plugins.
134144
135145``` js
136146{
137147 plugins: [
138- require (" postcss-sass- stuff" ),
139- require (" postcss-more-crazy- stuff" ),
148+ require (" postcss-stuff" ),
149+ require (" postcss-more-stuff" ),
140150 // custom transformation code
141- function (styles ) {
142-
151+ function (cssAst , result ) {
152+ // see https://github.com/postcss/postcss
143153 },
144154 ],
145155}
0 commit comments