File tree Expand file tree Collapse file tree 1 file changed +10
-21
lines changed Expand file tree Collapse file tree 1 file changed +10
-21
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ Pass an object of the following properties
67
67
| ` includePaths ` | ` {Array} ` | ` [] ` (Any) | An array of paths to be processed |
68
68
| ` getLocalIdent ` | ` Function ` | ` undefined ` | Generate the classname by specifying a function instead of using the built-in interpolation |
69
69
70
- ### ` getLocalIdent `
70
+ #### ` getLocalIdent `
71
71
72
72
Function to generate the classname instead of the built-in function.
73
73
@@ -113,26 +113,15 @@ SvelteApp
113
113
``` js
114
114
// Preprocess config
115
115
...
116
- preprocess: [
117
- cssModules ({
118
- localIdentName: ' [path][name]__[local]' ,
119
- getLocalIdent: (
120
- {
121
- context, // SvelteApp/src/components
122
- resourcePath // SvelteApp/src/components/Button.svelte
123
- },
124
- {
125
- template, // [path][name]__[local]
126
- interpolatedName // SvelteApp_src_components_Button__red
127
- },
128
- className, // red
129
- { style } // <style>.red { background-color: red; }</style>
130
- ) => {
131
- return interpolatedName .toLowerCase ().replace (' src_' , ' ' );
132
- // svelteapp_components_button__red;
133
- }
134
- })
135
- ],
116
+ preprocess: [
117
+ cssModules ({
118
+ localIdentName: ' [path][name]__[local]' ,
119
+ getLocalIdent : ( context , { interpolatedName }) => {
120
+ return interpolatedName .toLowerCase ().replace (' src_' , ' ' );
121
+ // svelteapp_components_button__red;
122
+ }
123
+ })
124
+ ],
136
125
...
137
126
```
138
127
You can’t perform that action at this time.
0 commit comments