Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit a984bce

Browse files
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)

AltStyle によって変換されたページ (->オリジナル) /