Re: [csswg-drafts] [css-nesting-2] Syntax to customize how a nest-containing selector is resolved? (#6330)

To stick with your example:
```html
<div class="foo"><div class="bar"><div class="foo"><p>Foo</p></div></div></div>
```
There are many ways to exclude the inner `.foo` with existing solutions, but `@scope` may help here too:
```css
.foo {
  .bar {
    & p {
      color: blue;

      .foo:focus * & {
        color: red; /* Outer .foo only */
      }

      /* or */

     .foo:focus .bar & {
       color: red; /* Outer .foo only */
      }

     /* … */
    }
  }
}
```


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


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

Received on Tuesday, 21 February 2023 20:34:33 UTC