Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The scroll-timeline
CSS shorthand property is used to define a named scroll progress timeline, which is progressed through by scrolling a scrollable element (scroller) between top and bottom (or left and right). scroll-timeline
is set on the scroller that will provide the timeline. The starting scroll position represents 0% progress and the ending scroll position represents 100% progress. If the 0% position and 100% position coincide (i.e., the scroll container has no overflow to scroll), the timeline is inactive.
scroll-timeline
can contain two constituent values — a name for the named scroll progress timeline, and an optional scroll axis value.
The name is then referenced in an animation-timeline
declaration to indicate the container's element that is used to drive the progress of the animation through the scrolling action.
Note: If the scroller does not overflow its container in the axis dimension or if the overflow is hidden or clipped, no timeline will be created.