[scroll-animations-2] consider [css-scoping] / `@scope` + `select()` for referencing scroller
Nobody has claimed this yet.
- Dominant language
- Bikeshed
- Stars
- 4.9k
- Forks
- 816
- PR merge metrics
- PR metrics pending
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read the linked Scroll-linked Animations and CSS Scoping specifications, along with issue #5809, to understand the existing naming and scoping proposals. Done would require a resolved standards direction on whether and how @scope and select() should be integrated, rather than a narrowly defined code change.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100