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
The query parameter `modules` enables the **CSS Modules** spec.
129
-
130
-
This enables local scoped CSS by default. (You can switch it off with `:global(...)` or `:global` for selectors and/or rules.).
131
-
132
-
#### `Scope`
133
-
134
-
By default CSS exports all classnames into a global selector scope. Styles can be locally scoped to avoid globally scoping styles.
135
-
136
-
The syntax `:local(.className)` can be used to declare `className` in the local scope. The local identifiers are exported by the module.
137
-
138
-
With `:local` (without brackets) local mode can be switched on for this selector. `:global(.className)` can be used to declare an explicit global selector. With `:global` (without brackets) global mode can be switched on for this selector.
139
-
140
-
The loader replaces local selectors with unique identifiers. The choosen unique identifiers are exported by the module.
To import from multiple modules use multiple `composes:` rules.
231
-
232
-
```css
233
-
:local(.className) {
234
-
composes: edit hightlight from './edit.css';
235
-
composes: button from 'module/button.css';
236
-
composes: classFromThisModule;
237
-
background: red;
238
-
}
239
-
```
240
-
241
-
### `localIdentName`
242
-
243
-
You can configure the generated ident with the `localIdentName` query parameter. See [loader-utils's documentation](https://github.com/webpack/loader-utils#interpolatename) for more information on options.
You can also specify the absolute path to your custom `getLocalIdent` function to generate classname based on a different schema. This requires `webpack >= 2.2.1` (it supports functions in the `options` object).
> ℹ️ For prerendering with extract-text-webpack-plugin you should use `css-loader/locals` instead of `style-loader!css-loader`**in the prerendering bundle**. It doesn't embed CSS but only exports the identifier mappings.
278
-
279
124
### `sourceMap`
280
125
281
126
To include source maps set the `sourceMap` option.
0 commit comments