Re: [csswg-drafts] [scroll-animations] Broader scope of scroll timelines (#7759)

Something Bramuslike could work in my opinon. Fundamentally this is about declaring something in one place, and defining it in another place. Using two different properties for this seems reasonable to me. How about this tweak:


```
scroll-timeline-root: [ none | <custom-ident> ]#
scroll-timeline-name: <custom-ident>#
scroll-timeline-axis: [ block | inline | x | y ]#
scroll-timeline: [ <custom-ident> [ <'scroll-timeline-axis'> || ancestor ]? ]#
```

 - `scroll-timeline-root` _declares_ the named timeline.
 - `scroll-timeline-name`, `-axis` (/ `-inset`) _defines_ the named timeline.
 - A given timeline definition always attaches to the nearest declaration (i.e. root) in the _inclusive_ flat tree ancestors, however:
 - The `scroll-timeline` shorthand by default will expand the `<custom-ident>` to both `-name` and `-root` properties, unless:
 - The `ancestor` keyword is provided, which instead expands the `<custom-ident>` to `-name` only, and expands `-root` to `none`.

Note that no _longhand_ accepts `ancestor` nor `defer`.

Examples:

- `scroll-timeline:foo block; => scroll-timeline-root:foo; scroll-timeline-name:foo; scroll-timeline-axis:block;`
- `scroll-timeline:foo block ancestor; => scroll-timeline-root:none; scroll-timeline-name:foo; scroll-timeline-axis:block;`
- `scroll-timeline-root:foo` => Effectively `scroll-timeline:name defer` in current spec terms.

If we need the "behave as local if no ancestor is found"-behavior, then we could do `scroll-timeline-root:auto` instead of `none`.


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


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

Received on Thursday, 27 April 2023 20:26:22 UTC