[csswg-drafts] [scroll-animations-1] consider [css-scoping] / @scope for referencing scroller (#8028)

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

== [scroll-animations-1] consider [css-scoping] / @scope for referencing scroller ==
With more and more CSS features relying on somehow "tagging" elements for later reference, like in [Scroll-linked Animations](https://www.w3.org/TR/2022/WD-scroll-animations-1-20221025/), and each time introducing new tagging vocabulary and mechanisms of their own, I wonder if it would make more sense to build upon @mirisuzanne's idea of [css-scoping](https://css.oddbird.net/scope/explainer/) / [issue #5809](https://github.com/w3c/csswg-drafts/issues/5809) / [CSS Scoping](https://drafts.csswg.org/css-scoping/) and combine that with the previously used `select()` function?

So instead of writing this:

```css
.scroll-container {
  scroll-timeline-name: foo;
}

.animated-sibling-or-child-of-scroll-container {
  animation-timeline: foo;
}
```

we could have this:

```css
@scope(.ancestor-of-both) {
  .animated-sibling-or-child-of-scroll-container {
    animation-timeline: scroll(select(:scope .scroll-container));
  }
}
```

Drawback of this would be that another not even started idea/spec would block the finalization of this one (and potential others). A solution could be to release Scroll-linked Animations the way it is currently planned and to upgrade it later to also support a CSS Scoping aware `select()` function for referencing the scroll container. 

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


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

Received on Sunday, 6 November 2022 09:09:22 UTC