-
Notifications
You must be signed in to change notification settings - Fork 756
Closed
Description
When creating an Anonymous Scroll Progress Timelines usning scroll() you can target either the root or the nearest scroller.
Currently nearest is defined as:
Specifies to use the nearest ancestor scroll container. (Default.)
This does not allow authors to create an Anonymous Scroll Progress Timeline that uses the element itself, as nearest only looks to ancestors. E.g. the code below does not work when .container is the scroller
.container {
animation: 1s bg-scale both linear;
animation-timeline: scroll(nearest inline);
}As a result, authors must use a named Scroll Progress Timeline instead:
.container {
animation: 1s bg-scale both linear;
scroll-timeline: --self inline;
animation-timeline: --self;
}This seems like a bit a hassle. Can we adjust nearest so that it starts looking from the targeted element itself first, and only then to ancestors? Or maybe introduce a new keyword self should altering nearest introduce some nasty side-effects?