With more and more CSS features relying on somehow "tagging" elements for later reference, like in Scroll-linked Animations, 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 / issue #5809 / CSS Scoping and combine that with the previously used select() function?
So instead of writing this:
.scroll-container {
scroll-timeline-name: foo;
}
.animated-sibling-or-child-of-scroll-container {
animation-timeline: foo;
}
we could have this:
@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.
With more and more CSS features relying on somehow "tagging" elements for later reference, like in Scroll-linked Animations, 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 / issue #5809 / CSS Scoping and combine that with the previously used
select()function?So instead of writing this:
we could have this:
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.