You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+33-2Lines changed: 33 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,8 @@ Seamless mapping of class names to CSS modules inside of React components.
7
7
8
8
-[What's the Problem?](#whats-the-problem)
9
9
-[Usage](#usage)
10
+
-[webpack](#webpack)
11
+
-[Browserify](#browserify)
10
12
-[Options](#options)
11
13
-[`allowMultiple`](#allowmultiple)
12
14
-[`keepOriginal`](#keeporiginal)
@@ -80,6 +82,37 @@ Refer to the [react-css-modules-examples](https://github.com/gajus/react-css-mod
80
82
81
83
## Usage
82
84
85
+
Setup a module bundler to load your [ICSS](https://github.com/css-modules/icss).
86
+
87
+
### webpack
88
+
89
+
* Install [`style-loader`](https://www.npmjs.com/package/style-loader) and [`css-loader`](https://www.npmjs.com/package/css-loader).
90
+
* You will also need to use [`extract-text-webpack-plugin`](https://www.npmjs.com/package/extract-text-webpack-plugin) to aggregate the CSS into a single file.
Refer to [webpack-demo](https://github.com/css-modules/webpack-demo) or [react-css-modules-examples](https://github.com/gajus/react-css-modules-examples) for a complete setup.
109
+
110
+
### Browserify
111
+
112
+
Refer to [`css-modulesify`](https://github.com/css-modules/css-modulesify).
113
+
114
+
### `CSSModules`
115
+
83
116
```js
84
117
/**
85
118
* @typedefCSSModules~Options
@@ -96,8 +129,6 @@ Refer to the [react-css-modules-examples](https://github.com/gajus/react-css-mod
96
129
*/
97
130
```
98
131
99
-
First you need to setup [webpack](http://webpack.github.io/docs/) to load your css files using "css" loader and enable CSS modules. You will also need to use `extract-text-webpack-plugin` to aggregate the CSS into a single file. Refer to [webpack-demo](https://github.com/css-modules/webpack-demo).
100
-
101
132
Then you need to decorate your component using `CSSModules`, e.g.
0 commit comments