Skip to content

Commit b4ff315

Browse files
committed
doc: links to examples
1 parent 6a8a0fb commit b4ff315

File tree

1 file changed

+22
-8
lines changed

1 file changed

+22
-8
lines changed

README.md

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525

2626
## Motivation
2727

28-
Define React presentational components with CSS.
28+
Define React presentational components with CSS (or even SASS or Less if you
29+
like).
2930

3031
The implementation is based on [CSS modules][]. In fact React CSS Components is
3132
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:
162163
<Label mode="emphasis" /> // sets both classes with `color` and `font-weight`
163164
```
164165

165-
## Advanced configuration
166+
## Customizing CSS loading
166167

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.
168170

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*.
170174

171-
### Using with Sass/Less/Stylus/...
175+
### CSS extraction
172176

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.
174181

175-
### Using with custom PostCSS plugins (including autoprefixer)
182+
### Using with SASS/SCSS/LESS/Stylus/...
176183

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.
178192

179193
[CSS modules]: https://github.com/css-modules/css-modules

0 commit comments

Comments
 (0)