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
6767| ` includePaths ` | ` {Array} ` | ` [] ` (Any) | An array of paths to be processed |
6868| ` getLocalIdent ` | ` Function ` | ` undefined ` | Generate the classname by specifying a function instead of using the built-in interpolation |
6969
70- ### ` getLocalIdent `
70+ #### ` getLocalIdent `
7171
7272Function to generate the classname instead of the built-in function.
7373
@@ -113,26 +113,15 @@ SvelteApp
113113``` js
114114// Preprocess config
115115...
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+ ],
136125...
137126```
138127
You can’t perform that action at this time.
0 commit comments