[csswg-drafts] [scroll-animations-1] Bring back Scroll Offsets (#7575)

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

== [scroll-animations-1] Bring back Scroll Offsets ==
One of the things that did not make it into the scroll-animations rewrite is the ability to animate as at a scroller scrolls for a fixed distance. This used to be covered by the scroll-offsets.

There are some use-cases, such as [this cover page that transforms to a header bar](https://codepen.io/bramus/pen/PoRKORX?editors=0010) as you scroll over a distance of `90vh`.

One could use use a `ViewTimeline` here, but not on the cover/header because it is sticky and therefore never `exit`s. Instead, one would have to look at the succeeding element.

This, however, is only possible if all of these apply:
1. There is a succeeding element
2. That succeeding element is not in view at the start of the animations, so you can watch it `enter`
3. The ViewTimeline can be seen by the preceding header

The first 2 conditions might not always be the case, but the author could work around that if they rearrange some things in their markup. The 3rd condition is not possible, since we decided in https://github.com/w3c/csswg-drafts/issues/7047 to have “timeline search look at preceding siblings and ancestors”.

Therefore I think we should reintroduce the Scroll Offsets.

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


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

Received on Thursday, 4 August 2022 21:37:05 UTC