Re: [csswg-drafts] [css-nesting] selecting grandparent selector with @nest (#6977)

Whatabout `:parent` pseudo-class? Same as your proposal, but maybe more cleaner syntax.

```css
.container {
 & .widget {
  @nest &:parent.selected {
   /* Gets rewritten to .container.selected .widget */
  }
 } 
}
```

Still this as an advanced usage, and maybe needed only in few cases. 

Selecting top level grandparent is much common use as I mentioned previously. But that is not clear if it's possible with the current spec or not - that is my main concern

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


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

Received on Sunday, 23 January 2022 11:41:29 UTC