Skip to content

Commit a984bce

Browse files
committed
readme update
1 parent ed6dca2 commit a984bce

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,13 @@ hook({
5656
});
5757
```
5858

59-
### Specify custom function to build generic names
59+
### Specify custom pattern to build generic names
6060

6161
```javascript
6262
var hook = require('css-modules-require-hook');
6363

64-
// specify your custom function
65-
function generateScopedName(exportedName, path) {/* your code here */}
66-
6764
hook({
68-
generateScopedName: generateScopedName,
65+
generateScopedName: '[name]__[local]___[hash:base64:5]',
6966
});
7067
```
7168

@@ -164,6 +161,15 @@ Short alias for the [postcss-modules-extract-imports](https://github.com/css-mod
164161
### `generateScopedName` function
165162

166163
Short alias for the [postcss-modules-scope](https://github.com/css-modules/postcss-modules-scope) plugin's option. Helps you to specify the custom way to build generic names for the class selectors.
164+
You may also use a string pattern similar to the webpack's [css-loader](https://github.com/webpack/css-loader#local-scope).
165+
166+
```javascript
167+
hook({
168+
generateScopedName: '[name]__[local]___[hash:base64:5]'
169+
});
170+
```
171+
172+
or
167173

168174
```javascript
169175
hook({

0 commit comments

Comments
 (0)