@@ -49,11 +49,14 @@ Each feature is based on PostCSS plugins & can get its own options.
49
49
To pass options to a feature, you can just pass an object to the feature:
50
50
51
51
``` js
52
- // eg: preserve custom properties
52
+ // eg: pass variables
53
53
var output = cssnext (input, {
54
54
features: {
55
55
customProperties: {
56
- preserve: true
56
+ variables: {
57
+ mainColor: " red" ,
58
+ altColor: " blue" ,
59
+ }
57
60
}
58
61
}
59
62
})
@@ -107,12 +110,19 @@ _(default: `true`)_
107
110
Allows you to inline local ` @import ` files
108
111
(thanks to [ postcss-import] ( https://github.com/postcss/postcss-import#readme ) ):
109
112
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
112
122
113
123
_ Note: you can pass
114
124
[ postcss-import options] ( https://github.com/postcss/postcss-import#readme )
115
- directly._
125
+ directly if needed ._
116
126
117
127
## ` url `
118
128
@@ -127,19 +137,19 @@ directly in order to inline or have more control over urls._
127
137
128
138
## ` plugins `
129
139
130
- _ (default: undefined )_
140
+ _ (default: ` [] ` )_
131
141
132
142
Allows you to pass your own array of transformations. You can just pass your own
133
143
[ PostCSS] ( https://github.com/postcss/postcss ) plugins.
134
144
135
145
``` js
136
146
{
137
147
plugins: [
138
- require (" postcss-sass- stuff" ),
139
- require (" postcss-more-crazy- stuff" ),
148
+ require (" postcss-stuff" ),
149
+ require (" postcss-more-stuff" ),
140
150
// custom transformation code
141
- function (styles ) {
142
-
151
+ function (cssAst , result ) {
152
+ // see https://github.com/postcss/postcss
143
153
},
144
154
],
145
155
}
0 commit comments