Skip to content

Commit 56c8792

Browse files
jantimonsamcx
andauthored
add native css nesting support (#62644)
today ~83% of all browsers support css nesting: https://caniuse.com/css-nesting ![CSS Nesting Browser Support](https://github.com/css-modules/postcss-modules-local-by-default/assets/4113649/141f8dce-a8bd-4df4-b2bd-210252189711) https://caniuse.com/css-nesting https://developer.mozilla.org/en-US/docs/Web/CSS/Nesting_selector therefore this pr upgrades postcss-modules-local-by-default which fixes a bug in css-modules/postcss-modules-local-by-default#64) - `.foo { &:hover { a_value: some-value; } }` is pure - `.foo { html &:hover { a_value: some-value; } }` is pure - `.foo { &:global(.bar) { a_value: some-value; } }` is pure - `:global(.foo) { &:hover { a_value: some-value; } }` is **not** pure upgrading the package will allow using css nestings with or **without** postcss compilation it fixes the following error: ``` CssSyntaxError: postcss-modules-local-by-default: <css input>:1:8: Selector "&:hover" is not pure (pure selectors must contain at least one local class or id) ``` Fixes #55053 Fixes #33734 Fixes #10475 Co-authored-by: Sam Ko <[email protected]>
1 parent a34bfcd commit 56c8792

File tree

2 files changed

+21
-21
lines changed

2 files changed

+21
-21
lines changed

packages/next/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@
263263
"platform": "1.3.6",
264264
"postcss-flexbugs-fixes": "5.0.2",
265265
"postcss-modules-extract-imports": "3.0.0",
266-
"postcss-modules-local-by-default": "4.0.0",
266+
"postcss-modules-local-by-default": "4.0.4",
267267
"postcss-modules-scope": "3.0.0",
268268
"postcss-modules-values": "4.0.0",
269269
"postcss-preset-env": "7.4.3",

pnpm-lock.yaml

Lines changed: 20 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)