Skip to content

Commit

Permalink
Document
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 authored and devongovett committed Aug 28, 2024
1 parent 55c5f42 commit 7bf90ff
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions website/pages/css-modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,26 @@ let { code, map, exports } = transform({

</div>


### Pure mode

Just like the `pure` option of the `css-loader` for webpack, Lightning CSS also has a `pure` option that enforces usage of one or more id or class selectors for each rule.


```js
let {code, map, exports} = transform({
// ...
cssModules: {
pure: true,
},
});
```

If you enable this option, Lightning CSS will throw an error for CSS rules that don't have at least one id or class selector, like `div`.
This is useful because selectors like `div` are not scoped and affects all elements on the page.



## Turning off feature scoping

Scoping of grid, animations, and custom identifiers can be turned off. By default all of these are scoped.
Expand Down

0 comments on commit 7bf90ff

Please sign in to comment.