Skip to content

[scroll-animations-1] Syntax of animation-range is ambiguous #8557

Closed as not planned
@ydaniv

Description

@ydaniv

Since we resolved in #7575 to allow <length-percentage> to be used as offsets in animation-range, it's now possible to have a range of:

.source {
  animation-timeline: view(self);
  animation-range: entry 0 contain 20%;
}

Which can now mean 2 things:

  1. The animation's progress is at 100% when .source is at 20% of its contain range.
  2. The animation's progress is at 100% when .source is at contain 0% + 20% of its parent's size (according to timeline's axis).

In order to be able to distinguish between the 2 cases we have the following options:

  1. Make ranges functions, so that contain 20% becomes contain(20%)
  2. Disallow <percentage> so that it only means 1. from the options above. But that seems suboptimal.
  3. Adopt suggestions in [scroll-animations-1][css-animations-2] Add animation-range to animation shorthand #8054 to use the offset() and range() notations so that we get offset(contain 20%)

Anyhow, since we already have other ambiguity issues raised in #8054, I guess we could solve both by adopting either option 1 or option 3.

cc @flackr @fantasai @bramus

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions