-
Notifications
You must be signed in to change notification settings - Fork 23k
CSS property pages: animation-range-start and animation-range-end #42029
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
base: main
Are you sure you want to change the base?
Conversation
Merge remote-tracking branch 'upstream/main'
|
Preview URLs
Flaws (29)URL:
URL:
External URLs (2)URL:
URL:
(comment last updated: 2025-12-05 16:08:19) |
Added global values for the animation-range-end property.
Added global values for animation-range-start property.
dipikabh
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.
Thanks for sending these updates!
I've added my suggestions and feedback
files/en-us/web/css/reference/properties/animation-range-end/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/css/reference/properties/animation-range-end/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/css/reference/properties/animation-range-end/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/css/reference/properties/animation-range-end/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/css/reference/properties/animation-range-end/index.md
Outdated
Show resolved
Hide resolved
| } | ||
| ``` | ||
|
|
||
| We also include conditional styling: when the checkbox is checked, the `animation-fill-mode` property gets applied to the animated element: |
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.
| We also include conditional styling: when the checkbox is checked, the `animation-fill-mode` property gets applied to the animated element: | |
| When the checkbox is checked, the `animation-fill-mode` property gets applied to the animated element: |
| } | ||
| ``` | ||
|
|
||
| The other styles were hidden for the sake of brevity. |
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 other styles were hidden for the sake of brevity. | |
| Other styles applied in this example have been hidden here for brevity. |
files/en-us/web/css/reference/properties/animation-range-end/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/css/reference/properties/animation-range-end/index.md
Outdated
Show resolved
Hide resolved
|
This pull request has merge conflicts that must be resolved before it can be merged. |
dipikabh
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.
Thanks for the updates, @estelle!
Two suggestions got missed - #42029 (comment) and #42029 (comment). I've also added a few edits on the animation-range-start page. Leaving my +1 so you can merge when it's ready.
| - {{cssxref("length-percentage")}} | ||
| - : Specifies a length or percentage value measured from the beginning of the timeline. | ||
| - [`<timeline-range-name>`](/en-US/docs/Web/CSS/Reference/Values/timeline-range-name) | ||
| - : Specifies a specific named timeline range within the overall timeline. The range starts at `0%`. |
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.
seems redundant
| - : Specifies a specific named timeline range within the overall timeline. The range starts at `0%`. | |
| - : Specifies a named timeline range within the overall timeline. The range starts at `0%`. |
| ## Description | ||
|
|
||
| Also check out the [View Timeline Ranges Visualizer](https://scroll-driven-animations.style/tools/view-timeline/ranges/), which shows exactly what the different values mean in an easy visual format. | ||
| The `animation-range-end` property specifies the end of the animation's attachment range, potentially shifting the end time of the animation (i.e., where keyframes mapped to `100%` progress are attached when the iteration count is 1) and/or reducing the duration of the animation. |
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 `animation-range-end` property specifies the end of the animation's attachment range, potentially shifting the end time of the animation (i.e., where keyframes mapped to `100%` progress are attached when the iteration count is 1) and/or reducing the duration of the animation. | |
| The `animation-range-end` property specifies the end of the animation's attachment range. Changing the end of the attachment range can potentially shift the end of the animation, that is, the point where keyframes mapped to `100%` progress land when the iteration count is `1`, and can also reduce the effective duration of the animation. |
| ``` | ||
|
|
||
| <div class="subject animation"></div> | ||
| In the middle of a long block of text, we've includes an element that we'll animate. We've added a lot of text to ensure that the content overflows its container; the extra text is hidden here for brevity. |
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.
my bad, sorry
| In the middle of a long block of text, we've includes an element that we'll animate. We've added a lot of text to ensure that the content overflows its container; the extra text is hidden here for brevity. | |
| In the middle of a long block of text, we've included an element that we'll animate. We've added a lot of text to ensure that the content overflows its container; the extra text is hidden here for brevity. |
| - {{cssxref("length-percentage")}} | ||
| - : Specifies a length or percentage value measured from the beginning of the timeline. | ||
| - [`<timeline-range-name>`](/en-US/docs/Web/CSS/Reference/Values/timeline-range-name) | ||
| - : Specifies a specific named timeline range within the overall timeline. The range starts at `0%`. |
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.
| - : Specifies a specific named timeline range within the overall timeline. The range starts at `0%`. | |
| - : Specifies a named timeline range within the overall timeline. The range starts at `0%`. |
| In the case of [`<timeline-range-name>`](/en-US/docs/Web/CSS/Reference/Values/timeline-range-name) values that do not include a `<length-percentage>`, the percentage defaults to `0%`. | ||
|
|
||
| Allowed values for the `animation-range-start` property are `normal`, a {{cssxref("length-percentage")}}, a `<timeline-range-name>`, or a `<timeline-range-name>` with a `<length-percentage>` following it. See [`animation-range`](/en-US/docs/Web/CSS/animation-range) for a detailed description of the available values. | ||
|
|
||
| Also check out the [View Timeline Ranges Visualizer](https://scroll-driven-animations.style/tools/view-timeline/ranges/), which shows exactly what the different values mean in an easy visual format. |
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.
These need to be reordered for the appropriate flow of content: 2nd para, then 1st, and then 3rd. They can also all be combined into a single para.
| In the case of [`<timeline-range-name>`](/en-US/docs/Web/CSS/Reference/Values/timeline-range-name) values that do not include a `<length-percentage>`, the percentage defaults to `0%`. | |
| Allowed values for the `animation-range-start` property are `normal`, a {{cssxref("length-percentage")}}, a `<timeline-range-name>`, or a `<timeline-range-name>` with a `<length-percentage>` following it. See [`animation-range`](/en-US/docs/Web/CSS/animation-range) for a detailed description of the available values. | |
| Also check out the [View Timeline Ranges Visualizer](https://scroll-driven-animations.style/tools/view-timeline/ranges/), which shows exactly what the different values mean in an easy visual format. | |
| Allowed values for the `animation-range-start` property are `normal`, a {{cssxref("length-percentage")}}, a `<timeline-range-name>`, or a `<timeline-range-name>` followed by a `<length-percentage>`. If the [`<timeline-range-name>`](/en-US/docs/Web/CSS/Reference/Values/timeline-range-name) value does not include a `<length-percentage>`, the percentage defaults to `0%`. | |
| See [`animation-range`](/en-US/docs/Web/CSS/animation-range) for a detailed description of the available values. | |
| Also check out the [View progress timeline visualizer](https://scroll-driven-animations.style/tools/view-timeline/ranges/), which shows what the different values mean in an easy-to-follow visual format. |
| The `animation-range-start` and {{cssxref("animation-range-end")}} properties can also be set using the {{cssxref("animation-range")}} shorthand property. | ||
|
|
||
| The `animation-range-start` is included in the {{cssxref("animation")}} shorthand as a reset-only value. This means that using the `animation` shorthand resets any previously declared `animation-range-start` value of equal or lower specificity to `normal`; the shorthand cannot be used to set a new `animation-range-start` value. When creating [CSS scroll-driven animations](/en-US/docs/Web/CSS/Guides/Scroll-driven_animations), you should declare `animation-range-start` _after_ declaring any `animation` shorthand to avoid resetting the value to `normal`. |
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.
Swapping the order here:
| The `animation-range-start` and {{cssxref("animation-range-end")}} properties can also be set using the {{cssxref("animation-range")}} shorthand property. | |
| The `animation-range-start` is included in the {{cssxref("animation")}} shorthand as a reset-only value. This means that using the `animation` shorthand resets any previously declared `animation-range-start` value of equal or lower specificity to `normal`; the shorthand cannot be used to set a new `animation-range-start` value. When creating [CSS scroll-driven animations](/en-US/docs/Web/CSS/Guides/Scroll-driven_animations), you should declare `animation-range-start` _after_ declaring any `animation` shorthand to avoid resetting the value to `normal`. | |
| The `animation-range-start` is included in the {{cssxref("animation")}} shorthand as a reset-only value. This means that using the `animation` shorthand resets any previously declared `animation-range-start` value of equal or lower specificity to `normal`; the shorthand cannot be used to set a new `animation-range-start` value. When creating [CSS scroll-driven animations](/en-US/docs/Web/CSS/Guides/Scroll-driven_animations), you should declare `animation-range-start` _after_ declaring any `animation` shorthand to avoid resetting the value to `normal`. | |
| The `animation-range-start`, along with the {{cssxref("animation-range-end")}} property, can also be set using the {{cssxref("animation-range")}} shorthand. |
| ### Creating a scroll view progress timeline with range start | ||
|
|
||
| An `animation-range-start` declaration is also set to make the animation begin later than expected. | ||
| In this example, the `animation-range-start` is applied to an element animated via a scroll progress timeline. This makes the animation to begin animating well before the element enters the scrollport. |
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.
| In this example, the `animation-range-start` is applied to an element animated via a scroll progress timeline. This makes the animation to begin animating well before the element enters the scrollport. | |
| In this example, the `animation-range-start` is applied to an element animated via a scroll progress timeline. This makes the animation start well before the element enters the scrollport. |
| ``` | ||
|
|
||
| <div class="subject animation"></div> | ||
| In the middle of a long block of text, we've includes an element that we'll animate. We've added a lot of text to ensure that the content overflows its container; the extra text is hidden here for brevity. |
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.
| In the middle of a long block of text, we've includes an element that we'll animate. We've added a lot of text to ensure that the content overflows its container; the extra text is hidden here for brevity. | |
| In the middle of a long block of text, we've included an element that we'll animate. We've added a lot of text to ensure that the content overflows its container; the extra text is hidden here for brevity. |
| } | ||
| ``` | ||
|
|
||
| The other styles applied in this example has been hidden here for brevity. |
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 other styles applied in this example has been hidden here for brevity. | |
| Other styles applied in this example have been hidden here for brevity. |
| #### Result | ||
|
|
||
| Scroll to see the subject element being animated. | ||
| Scroll to see the element animate. Notice how the element is 25% of the width of it's final state and semi-opaque as it enters the viewport. This is because the element started animating well before it entered the viewport. |
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.
is "25% of the width" correct?
| Scroll to see the element animate. Notice how the element is 25% of the width of it's final state and semi-opaque as it enters the viewport. This is because the element started animating well before it entered the viewport. | |
| Scroll to see the element animate. Notice how the element is already scaled and semi-opaque as it enters the viewport. This is because the element started animating well before it entered the viewport. |
<timeline-range-name>is in #42020, so will be added around the same time as this.