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

D'oh! I messed up the example, took screen end instead of start, should be:

```css
.target {
  animation-range-start: max(0%, 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.

I guess this requires transforming range names into functions, and then they could be simply parsed as `<length>`, right?
Is there another option?

> 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;
> }
> ```

Yes of course, it's useful for names in that way, but useless for absolute values.

> While we could do something different when no range name is given, I worry that it would be very magical, and also make it harder to work with calcs. E.g. imagine your calc sometimes produces a negative value - it shouldn't suddenly flip to the end of the range.

Yep, that's a real concern. I guess this is something that can be added later if demand arises.

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


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

Received on Sunday, 14 May 2023 07:18:57 UTC