Skip to content

Commit 2922cee

Browse files
committed
Add plugins documentation
1 parent 93e82ee commit 2922cee

File tree

1 file changed

+32
-1
lines changed

1 file changed

+32
-1
lines changed

README.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# css-modulesify
22

3-
A browserify transform to load [CSS Modules](https://github.com/css-modules/css-modules).
3+
A browserify transform to load [CSS Modules].
4+
5+
[CSS Modules]: https://github.com/css-modules/css-modules
46

57
**Please note that this is still highly experimental.**
68

@@ -27,6 +29,35 @@ var div = `<div class="${styles.inner}">...</div>`;
2729

2830
The generated css will contain locally-scoped versions of any css you have `require`'d, and will be written out to the file you specify in the `--output` or `-o` option.
2931

32+
### PostCSS Plugins
33+
34+
The following PostCSS plugins are enabled by default:
35+
36+
* [postcss-modules-local-by-default]
37+
* [postcss-modules-extract-imports]
38+
* [postcss-modules-scope]
39+
40+
(i.e. the [CSS Modules] specification).
41+
42+
You can supply your own additional PostCSS Plugins by passing `--use|-u` to `css-modulesify`.
43+
44+
In addion you may also wish to configure defined PostCSS plugins by passing `--plugin.option true`.
45+
46+
An example of this would be:
47+
48+
```
49+
browserify -p [css-modulesify -u postcss-modules-local-by-default \
50+
-u postcss-modules-extract-imports \
51+
-u postcss-modules-scope \
52+
-u postcss-color-rebeccapurple \
53+
-u autoprefixer --autoprefixer.browsers '> 5%' \
54+
-o dist/main.css] -o dist/index.js src/index.js
55+
```
56+
57+
[postcss-modules-local-by-default]: https://github.com/css-modules/postcss-modules-local-by-default
58+
[postcss-modules-extract-imports]: https://github.com/css-modules/postcss-modules-extract-imports
59+
[postcss-modules-scope]: https://github.com/css-modules/postcss-modules-scope
60+
3061
## Example
3162

3263
An example implementation can be found [here](https://github.com/css-modules/browserify-demo).

0 commit comments

Comments
 (0)