-
Notifications
You must be signed in to change notification settings - Fork 23.1k
Scroll-driven animations: animation-range and <timeline-range-name> data type #42020
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Preview URLs
Flaws (39)URL:
URL:
URL:
External URLs (2)URL:
URL:
(comment last updated: 2025-11-27 12:20:06) |
chrisdavidmills
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@estelle some comments for you to consider.
files/en-us/web/css/reference/properties/animation-range/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/css/reference/properties/animation-range/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/css/reference/properties/animation-range/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/css/reference/properties/animation-range/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/css/reference/properties/animation-range/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/css/reference/properties/animation-range/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/css/reference/properties/animation-range/index.md
Outdated
Show resolved
Hide resolved
|
This pull request has merge conflicts that must be resolved before it can be merged. |
|
This pull request has merge conflicts that must be resolved before it can be merged. |
chrisdavidmills
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@estelle A few more bits for you on this one.
| ### Values | ||
| ## Description | ||
|
|
||
| The `animation-range` shorthand property sets the `animation-range-start` and `animation-range-end` values, defining where along the animation timeline the animation will start and end. By default, animation keyframe effects are only applied to the elements when the animation is applied to the element based on the `animation-timeline`, meaning the animation is only applied between the range start and range end. To apply the animation outside of this range, set the {{cssxref("animation-fill-mode")}} to `backwards`, `forwards`, or `both`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"By default, animation keyframe effects are only applied to the elements when the animation is applied to the element based on the animation-timeline..." - this is really confusing, and I'm not sure what you're trying to say.
Maybe something like "By default, animation styles are only applied to animated elements during the animation..."
|
|
||
| The {{glossary("Scroll container", "scroll port")}} area known as the view progress visibility range is the area inside which the subject element of a [named view progress timeline](/en-US/docs/Web/CSS/Guides/Scroll-driven_animations/Timelines#view_progress_timelines) animation is deemed to be visible. By default, this is the full range of the scrollport, but it can be adjusted using the {{cssxref("view-timeline-inset")}} property. | ||
|
|
||
| If two values are specified as components of the `<animation-range>` property, they will be interpreted in the order `<animation-range-start>` then `<animation-range-end>`. The value of each component is either the keyword `normal` or a {{cssxref("length-percentage")}} or a [`<timeline-range-name>`](/en-US/docs/Web/CSS/Reference/Values/timeline-range-name), optionally defined with a `<length-percentage>`. These values are space-separated. Normal is equal to `0%` for start and `100%` for end. Setting `normal` with a `<length-percentage>` for either the start or end range is invalid. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"The value of each component is either the keyword normal or a {{cssxref("length-percentage")}} or a <timeline-range-name>" - it can be a <length-percentage> and a <timeline-range-name>, no? Did you mean and/or?
files/en-us/web/css/reference/properties/animation-range/index.md
Outdated
Show resolved
Hide resolved
| Note how the `from`, or `0%`, keyframe property values are not applied to the animated element until the top block border edge is `10%` past the container's bottom edge; it is full size, fully opaque, and magenta. At that point, the animation is applied and it is styled with the values defined by the `0%` keyframe selector. When the `animation-range-end` is reached, 25% from the top of the scrollport, it jumps back to its original styling. | ||
|
|
||
| {{EmbedLiveSample("Creating a named view progress timeline with range", "100%", "480px")}} | ||
| The jumping to the default state occurs because we did not set the {{cssxref("animation-fill-mode")}} property on the element, which can be used to apply an animation's styles to an element before and after the animation's execution. We've omitted the property in this example to better enable visualizing the effects of `animation-range`.But, generally, you will want to set `animation-fill-mode: both` when creating [scroll-driven animations](/en-US/docs/Web/CSS/Guides/Scroll-driven_animations). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This explanation doesn't make sense. You've mentioned that you'll probably want to set animation-fill-mode: both, which is good, but you say that we've omitted it from this example, which is incorrect — you've provided a checkbox to allow readers to compare the results with and without. But you no longer talk about it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rearranged it to clarify
chrisdavidmills
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@estelle OK, this is looking much better now, nice work. I have left a few more minor grammar suggestions, but I'm approving, so you can consider these and then get it in.
files/en-us/web/css/reference/properties/animation-range/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/css/reference/properties/animation-range/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/css/reference/properties/animation-range/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/css/reference/properties/animation-range/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/css/reference/properties/animation-range/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/css/reference/properties/animation-range/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/css/reference/properties/animation-range/index.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Chris Mills <chrisdavidmills@gmail.com>
<timeline-range-name>animation-rangeshorthand property.