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

> Another use-case for explicitly clamping, the following can work for ensuring something animates from entry, even if in some screen/layout it appears in first fold, and in others it's below:
> 
> ```css
> .target {
>   animation-range-start: max(100vh, entry 0%);
>   animation-range-end: contain 50%;
> }
> ```

I suspect it would be hard to support range names within the calc. Maybe it could be done - since the entry 0% effectively turns into a proportion of the timeline range which is comparable with 100vh - but I think this could get complex.

> Regarding negative values, if we'll use absolute values without a range name to refer to the entire scroll range, then negative values become practically useless. Perhaps we should consider again using these to specify offsets from the end of the scroll range?

I think negative values are still useful when associated with a range name, e.g.
```css
.target {
  /* Start 50px before the contain phase */
  animation-range-start: contain -50px;
}
```

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


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

Received on Saturday, 13 May 2023 16:13:05 UTC