Re: [csswg-drafts] [css-nesting-1] & representing parent elements vs parent selector (#8310)

Yeah, I'm going to withdraw this suggestion, for a few reasons.

1. While I think the behavior with `.a .b { .c & {...}}` is reasonable, I think `.a .b { .c + & {...}}`'s behavior is fairly bad under this suggestion, and `.a .b { & + & {...}}` completely nonsensical.
2. The currently-specced behavior matches the behavior of other nested approaches, notably @scope, and being able to transfer rules to/from @scope with minimal editting was one of the arguments made for the current syntax in the first place.
3. While there's a certain degree of selector-length blowup as nesting depth increases in the current spec, this suggestion makes the blowup much worse. (Still not as bad as trying to match the current spec *without* `:is()`, which causes a *combinatorial* blowup rather than just multiplicative, but still.)

The only thing that gives me pause is that this suggestion's behavior can't be reproduced manually (without just unnesting entirely), while if we switched to this suggestion then the current spec's behavior can be easily opted into. I think it would be valuable to pursue having a way to opt into this suggestion's behavior, and will open a fresh issue for that.

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8310#issuecomment-1397648398 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 19 January 2023 21:45:28 UTC