Re: [csswg-drafts] [scroll-animations-1][css-animations-2] Out-of-range range offsets (#8578)

> Because we ignore the transforms, the animation will actually start when the element is 500px above cover 0%

Technically the element isn't 500px above cover until the animation starts 😉

I think that either options 1 or 2 should work. Note that the range name can't go inside the calc. Option 2 would be `animation-range: entry -500px exit calc(100% + 500px);`. `exit 500px` is equivalent to `exit calc(0% + 500px)` which is 500px after the *start* of the exit range which isn't what you want in your use case.

> So, if my conclusion is correct, it's either we clamp for simplicity's sake,

I don't think we should clamp. It results in animations which behave differently if the animated element is near the top/bottom of the document versus further down.

> or we allow offsets that are out-of-range?
I think we can allow out-of-range if that makes more sense to authors, no particular reason why not to allow it also.

Yes, I think we should allow out-of-range values.

Note I tested this and it seems the chromium implementation already supports this (requires a very recent version e.g. >=115.0.5767.0):
https://jsbin.com/hitegay/edit?html,css,js,output

-- 
GitHub Notification of comment by flackr
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8578#issuecomment-1546075715 using your GitHub account


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

Received on Friday, 12 May 2023 17:40:45 UTC