We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
After updating to postcss-nesting 10.1.9 I found regression in my UI.
postcss-nesting 10.1.9
I solved the problem by noIsPseudoSelector option.
noIsPseudoSelector
But why :is() is not working?
:is()
If it is my mistake, let’s improve ChangeLog.
.checkbox_icon::before { @nest .checkbox_input:checked + .checkbox_control > & { color: black } }
10.1.8 output works good:
.checkbox_input:checked + .checkbox_control > .checkbox_icon::before { color: black }
10.1.9 doesn’t work [at least] in Firefox 101
.checkbox_input:checked + .checkbox_control > :is(.checkbox_icon::before) { color: black; }
npx @csstools/csstools-cli <plugin-name> minimal-example.css
Yes
No response
PostCSS config:
{ "plugins": { "@csstools/postcss-oklab-function": { "subFeatures": { "displayP3": false } }, "postcss-opacity-percentage": {}, "postcss-mixins": { "mixinsFiles": "view/**/mixins.pcss" }, "postcss-nesting": {}, "postcss-media-minmax": {}, "autoprefixer": {} } }
PostCSS Nesting
10.1.9
18.4
The text was updated successfully, but these errors were encountered:
@ai thank you for reporting this!
It's a complex issue and a minimal repro would be :
.anything::before { @nest .something_else > & { color: black } } /* becomes */ .something_else > :is(.anything::before) { /* this is invalid CSS */ color: black; }
The root cause is that .anything::before is not a compound but a complex selector. I only learned about this recently.
.anything::before
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 ::before is not valid in :is().
::before
10.1.9 was intended to resolve issues with compound selector orders.
To resolve some selectors without :is we have to re-order compound selectors so that h1 and .foo aren't glued together as .fooh1.
:is
h1
.foo
.fooh1
But :focus::before and ::before:focus are not the same and we can not re-order these.
:focus::before
::before:focus
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.
.anything::before { @nest .something_else > & { color: black } }
.something_else > .anything::before {}
or
.anything.something_else::before {}
Sorry, something went wrong.
postcss-nesting : partially revert 10.1.9 and fix #510
c431f1c
8c8aa56
@ai this has just been released as 10.1.10. Thanks for reporting :)
romainmenke
No branches or pull requests
Bug description
After updating to
postcss-nesting 10.1.9
I found regression in my UI.I solved the problem by
noIsPseudoSelector
option.But why
:is()
is not working?If it is my mistake, let’s improve ChangeLog.
Source CSS
Expected CSS
10.1.8 output works good:
Actual CSS
10.1.9 doesn’t work [at least] in Firefox 101
Does it happen with
npx @csstools/csstools-cli <plugin-name> minimal-example.css
?Yes
Debug output
No response
Extra config
PostCSS config:
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
Would you like to open a PR for this bug?
The text was updated successfully, but these errors were encountered: