[csswg-drafts] [css-cascade-6] Introduce `:scope-end` pseudo to target end boundary (#8617)

bramus has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-cascade-6] Introduce `:scope-end` pseudo to target end boundary ==
In https://github.com/w3c/csswg-drafts/issues/8377 we resolved on allowing `:scope` within `@scope` to refers to the scope root element matched by `<scope-start>`. In that same thread, the idea for a `:scope-end` selector was also proposed. It would target the element(s) matched by the `<scope-end>`.

```css
@scope (.card) to (.content) {

  /* targets the .card scope start element */
  :scope {
    …
  }

  /* targets any img in between .card and .content scope elements */
  img {
    …
  }

  /* targets the .content scope end element */
  :scope-end {
    …
  }

}
```

In case no `<scope-end>` is set, `:scope-end` would match no element.

This tackles earlier questions of _“should the boundaries be included or not?”_, where the hacky fix was to adjust the end boundary selector to `(.content > *)` in order to be able to access `.content` from within `@scope`.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8617 using your GitHub account


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

Received on Monday, 20 March 2023 10:05:54 UTC