|
25 | 25 |
|
26 | 26 | ## Motivation
|
27 | 27 |
|
28 |
| -Define React presentational components with CSS. |
| 28 | +Define React presentational components with CSS (or even SASS or Less if you |
| 29 | +like). |
29 | 30 |
|
30 | 31 | The implementation is based on [CSS modules][]. In fact React CSS Components is
|
31 | 32 | just a thin API on top of CSS modules.
|
@@ -162,18 +163,31 @@ used to determine if corresponding CSS classes should be applied to DOM:
|
162 | 163 | <Label mode="emphasis" /> // sets both classes with `color` and `font-weight`
|
163 | 164 | ```
|
164 | 165 |
|
165 |
| -## Advanced configuration |
| 166 | +## Customizing CSS loading |
166 | 167 |
|
167 |
| -### CSS extraction with Webpack |
| 168 | +By default React CSS components loads CSS using `style-loader!css-loader` loader |
| 169 | +chain. That could be configured differently using `loadCSS` loader parameter. |
168 | 170 |
|
169 |
| -TODO: documentation |
| 171 | +This could be used to enable features such as *CSS extraction*, processing |
| 172 | +stylesheets with *PostCSS/Autoprefixer* or even authoring stylesheets with |
| 173 | +*SASS* or *LESS*. |
170 | 174 |
|
171 |
| -### Using with Sass/Less/Stylus/... |
| 175 | +### CSS extraction |
172 | 176 |
|
173 |
| -TODO: documentation |
| 177 | +See the [complete example](./examples/css-extraction/webpack.config.js) which |
| 178 | +configures |
| 179 | +[`extract-text-webpack-plugin`](https://github.com/webpack/extract-text-webpack-plugin) |
| 180 | +to extract stylesheets to a separate chunk. |
174 | 181 |
|
175 |
| -### Using with custom PostCSS plugins (including autoprefixer) |
| 182 | +### Using with SASS/SCSS/LESS/Stylus/... |
176 | 183 |
|
177 |
| -TODO: documentation |
| 184 | +See the [complete example](./examples/sass/webpack.config.js) which |
| 185 | +uses SASS/SCSS to create React components. |
| 186 | + |
| 187 | +### Using with PostCSS (including autoprefixer) |
| 188 | + |
| 189 | +See the [complete example](./examples/postcss//webpack.config.js) which |
| 190 | +configures PostCSS with Autoprefixer to automatically add vendor prefixes to |
| 191 | +stylesheets. |
178 | 192 |
|
179 | 193 | [CSS modules]: https://github.com/css-modules/css-modules
|
0 commit comments