[csswg-drafts] [scroll-animations-1] Allow Anonymous Scroll Progress Timelines to target self (#8227)

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

== [scroll-animations-1] Allow Anonymous Scroll Progress Timelines to target self ==
When creating an Anonymous Scroll Progress Timelines usning `scroll()` you can target either the `root` or the `nearest` scroller. 

Currently `nearest` is defined as:

> Specifies to use the nearest ancestor scroll container. _(Default.)_

This does not allow authors to create an Anonymous Scroll Progress Timeline that uses the element itself, as `nearest` only looks to ancestors. E.g. the code below does not work when `.container` is the scroller

```css
.container {
  animation: 1s bg-scale both linear;
  animation-timeline: scroll(nearest inline);
}
```

As a result, authors must use a named Scroll Progress Timeline instead:

```css
.container {
  animation: 1s bg-scale both linear;
  scroll-timeline: --self inline;
  animation-timeline: --self;
}
```

This seems like a bit a hassle. Can we adjust `nearest` so that it starts looking from the targeted element itself first, and only then to ancestors? Or maybe introduce a new keyword `self` should altering `nearest` introduce some nasty side-effects?

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


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

Received on Thursday, 15 December 2022 13:01:21 UTC