### Bug description After updating to `postcss-nesting 10.1.9` I found regression in [my UI](https://github.com/evilmartians/oklch-picker/blob/main/view/checkbox/index.css). I solved the problem by `noIsPseudoSelector` option. But why `:is()` is not working? If it is my mistake, let’s improve ChangeLog. ### Source CSS ```css .checkbox_icon::before { @nest .checkbox_input:checked + .checkbox_control > & { color: black } } ``` ### Expected CSS 10.1.8 output works good: ```css .checkbox_input:checked + .checkbox_control > .checkbox_icon::before { color: black } ``` ### Actual CSS 10.1.9 doesn’t work [at least] in Firefox 101 ```css .checkbox_input:checked + .checkbox_control > :is(.checkbox_icon::before) { color: black; } ``` ### Does it happen with `npx @csstools/csstools-cli <plugin-name> minimal-example.css`? Yes ### Debug output _No response_ ### Extra config PostCSS config: ```json { "plugins": { "@csstools/postcss-oklab-function": { "subFeatures": { "displayP3": false } }, "postcss-opacity-percentage": {}, "postcss-mixins": { "mixinsFiles": "view/**/mixins.pcss" }, "postcss-nesting": {}, "postcss-media-minmax": {}, "autoprefixer": {} } } ``` ### What plugin are you experiencing this issue on? PostCSS Nesting ### Plugin version 10.1.9 ### What OS are you experiencing this on? _No response_ ### Node Version 18.4 ### Validations - [X] Follow our [Code of Conduct](https://github.com/csstools/postcss-plugins/blob/master/CODE_OF_CONDUCT.md) - [X] Check that there isn't already an issue that request the same feature to avoid creating a duplicate. ### Would you like to open a PR for this bug? - [ ] I'm willing to open a PR
Activity
romainmenke commentedon Jun 29, 2022
@ai thank you for reporting this!
It's a complex issue and a minimal repro would be :
The root cause is that
.anything::beforeis not a compound but a complex selector.I only learned about this recently.
When a complex selector is the parent in a nested selector we wrap the parent with
:is()to match the spec.But at the same time
::beforeis not valid in:is().10.1.9was intended to resolve issues with compound selector orders.To resolve some selectors without
:iswe have to re-order compound selectors so thath1and.fooaren't glued together as.fooh1.But
:focus::beforeand::before:focusare not the same and we can not re-order these.I think we might need to roll back the changes (at least partly) in 10.1.9 and escalate this to CSS WG.
I actually have no idea how your case should be resolved and if it is valid (future) native CSS.
.something_else > .anything::before {}or
.anything.something_else::before {}postcss-nesting : partially revert 10.1.9 and fix #510
Antonio-Laguna commentedon Jun 30, 2022
@ai this has just been released as 10.1.10. Thanks for reporting :)