Skip to content

New guide: timeline range names#42853

Draft
estelle wants to merge 11 commits intomainfrom
arn
Draft

New guide: timeline range names#42853
estelle wants to merge 11 commits intomainfrom
arn

Conversation

@estelle
Copy link
Member

@estelle estelle commented Jan 21, 2026

Creates a new guide
Links to the guide
added two guides to the sidebar
crosslinking

This guide is really about names. I am currently working on another guide, which should be ready in a few weeks. #42105 that covers insetting view timelines. I pulled out the named ranges because it was getting overwhelming.

@estelle estelle requested a review from a team as a code owner January 21, 2026 15:26
@estelle estelle requested review from chrisdavidmills and removed request for a team January 21, 2026 15:26
@github-actions github-actions bot added Content:CSS Cascading Style Sheets docs size/l [PR only] 501-1000 LoC changed labels Jan 21, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 21, 2026

Preview URLs (9 pages)
Flaws (27)

Note! 5 documents with no flaws that don't need to be listed. 🎉

Found an unexpected or unresolvable flaw? Please report it here.

URL: /en-US/docs/Web/CSS/Reference/At-rules/@keyframes
Title: @keyframes
Flaw count: 3

  • broken_links:
    • Link /en-US/docs/Web/CSS/qualified-rule-list doesn't resolve
    • Link /en-US/docs/Web/CSS/custom-ident is a redirect
    • Link /en-US/docs/Web/CSS/string is a redirect

URL: /en-US/docs/Web/CSS/Reference/Properties/animation-range
Title: animation-range
Flaw count: 10

  • broken_links:
    • Link /en-US/docs/Web/CSS/animation-range-start is a redirect
    • Link /en-US/docs/Web/CSS/animation-range-end is a redirect
    • Link /en-US/docs/Web/CSS/timeline-range-name doesn't resolve
    • Link /en-US/docs/Web/CSS/timeline-range-name doesn't resolve
    • Link /en-US/docs/Web/CSS/length is a redirect
    • and 1 more flaws omitted
  • macros:
    • Macro cssinfo produces link /en-US/docs/Web/CSS/CSS_cascade/Value_processing which is a redirect
    • Macro cssinfo produces link /en-US/docs/Web/CSS/CSS_cascade/Inheritance which is a redirect
    • Macro cssinfo produces link /en-US/docs/Web/CSS/CSS_cascade/Value_processing which is a redirect
    • Macro cssinfo produces link /en-US/docs/Web/CSS/CSS_animated_properties which is a redirect

URL: /en-US/docs/Web/CSS/Reference/Properties/animation-range-end
Title: animation-range-end
Flaw count: 7

  • broken_links:
    • Link /en-US/docs/Web/CSS/timeline-range-name doesn't resolve
    • Link /en-US/docs/Web/CSS/length is a redirect
    • Link /en-US/docs/Web/CSS/percentage is a redirect
  • macros:
    • Macro cssinfo produces link /en-US/docs/Web/CSS/CSS_cascade/Value_processing which is a redirect
    • Macro cssinfo produces link /en-US/docs/Web/CSS/CSS_cascade/Inheritance which is a redirect
    • Macro cssinfo produces link /en-US/docs/Web/CSS/CSS_cascade/Value_processing which is a redirect
    • Macro cssinfo produces link /en-US/docs/Web/CSS/CSS_animated_properties which is a redirect

URL: /en-US/docs/Web/CSS/Reference/Properties/animation-range-start
Title: animation-range-start
Flaw count: 7

  • broken_links:
    • Link /en-US/docs/Web/CSS/timeline-range-name doesn't resolve
    • Link /en-US/docs/Web/CSS/length is a redirect
    • Link /en-US/docs/Web/CSS/percentage is a redirect
  • macros:
    • Macro cssinfo produces link /en-US/docs/Web/CSS/CSS_cascade/Value_processing which is a redirect
    • Macro cssinfo produces link /en-US/docs/Web/CSS/CSS_cascade/Inheritance which is a redirect
    • Macro cssinfo produces link /en-US/docs/Web/CSS/CSS_cascade/Value_processing which is a redirect
    • Macro cssinfo produces link /en-US/docs/Web/CSS/CSS_animated_properties which is a redirect

(comment last updated: 2026-01-28 07:45:51)

estelle and others added 2 commits January 21, 2026 16:33
…ange_names/index.md

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Copy link
Contributor

@chrisdavidmills chrisdavidmills left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@estelle Wow, that was a marathon review session! I'm really impressed at the effort you've put in to try to understand and explain this stuff. It is some of the most confusing CSS theory I've ever come across.

I think there is still some work to be done here. Most significantly, I am really missing some fundamental understanding of how the ranges affect the start and end animation positions, in the case of cover/contain. This stuff makes a lot more sense in the case of the entry and exit keywords...

But, great start, nice work.


In [view-progress timelines](/en-US/docs/Web/CSS/Guides/Scroll-driven_animations/Timelines#view_progress_timelines), keyframe progression is tied to how much of the element is visible within the scroller. As the element enters the viewport, the timeline advances. If the user reverses, the timeline reverses: as the view progress element comes into or moves out of view, the timeline progresses or reverses, respectively. The animation only occurs when the element is visible within its scrollport. If scrolling stops while the element is in view, the animation pauses.

By default, the view timeline progress starts when the tracked subject's start edge intersects the scrollport at the block or inline end edge and ends when the subject's end edge exits the scrollport at the block or inline start edge.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
By default, the view timeline progress starts when the tracked subject's start edge intersects the scrollport at the block or inline end edge and ends when the subject's end edge exits the scrollport at the block or inline start edge.
By default, the view timeline progress starts when the tracked subject's start edge intersects the scrollport at the end edge and ends when the subject's end edge exits the scrollport at the start edge. If the scrolling occurs in the inline direction, the referenced edges will be the subject and scrollport's inline edges. If the scrolling occurs in the block direction, the referenced edges will be the subject and scrollport's block edges.

I'm not sure if this is the most elegant way to say this, but I felt it should be qualified somehow. Alternatively (or in addition), maybe point the reader to https://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Scroll-driven_animations/Timelines#view_progress_timelines for information?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

went with

By default, the view timeline progress starts when the tracked subject's start edge intersects the scrollport at the end edge and ends when the subject's end edge exits the scrollport at the start edge. These are the subject and scrollport's top and bottom edges when scrolling vertically, and the left and right or right and left edges when scrolling horizontally, depending on the writing mode.


{{EmbedLiveSample("initial", "100%", "400")}}

Scroll down. Note how the animation begins just as the top edge of the animated element aligns with the bottom edge of the scroll container and ends, reaching `100%` progress, when the bottom edge aligns with the top edge of the container, no matter how tall the animated element is.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a really nice example. However, it isn't introduced beforehand. I'd suggest moving this paragraph above it and starting it along the lines of "In the following example, try scrolling down."


Scroll down. Note how the animation begins just as the top edge of the animated element aligns with the bottom edge of the scroll container and ends, reaching `100%` progress, when the bottom edge aligns with the top edge of the container, no matter how tall the animated element is.

By default, the element animates the entire time whenever any portion of the subject element is visible. This means the **animation attachment range** is the sum of the height of the scroll container and the height of the subject element. For example, if the scroll container is `250px` tall and the animated element is `50px` tall, the vertical animation attachment range will be `300px` tall. If the element is `250px` tall, the range becomes `500px`; if it's `500px` tall, the range becomes `750px`. This behavior is consistent regardless of element size; so we can use scroll view timelines even when we don't know the exact dimensions of our scroll containers or the dimensions of our subjects.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
By default, the element animates the entire time whenever any portion of the subject element is visible. This means the **animation attachment range** is the sum of the height of the scroll container and the height of the subject element. For example, if the scroll container is `250px` tall and the animated element is `50px` tall, the vertical animation attachment range will be `300px` tall. If the element is `250px` tall, the range becomes `500px`; if it's `500px` tall, the range becomes `750px`. This behavior is consistent regardless of element size; so we can use scroll view timelines even when we don't know the exact dimensions of our scroll containers or the dimensions of our subjects.
By default, the element is being animated for the entire time whenever any portion of the subject element is visible. This means the **animation attachment range** is the sum of the height of the scroll container and the height of the subject element. For example, if the scroll container is `250px` tall and the animated element is `50px` tall, the vertical animation attachment range will be `300px` tall. If the element is `250px` tall, the range becomes `500px`; if it's `500px` tall, the range becomes `750px`. This behavior is consistent regardless of element size, so we can use scroll view timelines even when we don't know the exact dimensions of our scroll containers or subjects.

Question: in my mind, the animation attachment range is the subject height, plus the height of the scrollport portion above the subject. Surely the portion of the scrollport after the subject is not included, because after the end edge of the subject has passed through the start edge of the scrollport, the animation is finished. Why isn't this the case?

Copy link
Member Author

@estelle estelle Jan 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the animation attachment range is the height of the scrollport plus the subject height on top of the scrollport, not the other way around. i think that is what might be confusing you .

Tried to clarify with the following:

By default, the element is being animated the entire time any portion of the subject element is visible. This means the animation attachment range is the sum of the height of the scroll container and the height of the subject element, with that extra height being at the scroll end edge. For example, if the scroll container is 250px tall and the animated element is 50px tall, the vertical animation attachment range will be 300px tall, starting at the bottom of the scrollport in our example. If the element is 250px tall, the range becomes 500px; if it's 500px tall, the range becomes 750px. This behavior is consistent regardless of element size; so we can use scroll view timelines even when we don't know the exact dimensions of our scroll containers or the dimensions of our subjects.


When the subjects are small enough to be fully contained within the viewport, the animation attachment timeline is at the start (`entry`) or end (`exit`) of the scrollport and the size of the attachment range is limited to the size of the animated element in the scroll direction. The percent offset, if any, is relative to the subject's size, not the viewport size.

If the animated element is the size of the viewport or larger, the animation doesn't begin until the element fully covers the scrollport in the scroll direction. If your animated element is larger than the scrollport, you may prefer to use `entry-crossing` and `exit-crossing`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't explain explicitly what is happening here when the 30% and 70% range is set. Doing som would be a good idea.

However, This example intuitively makes sense to me, unlike the earlier ones. I think this is because the offset is relative to the subject's size.


## Entry- and exit-crossing

If the animated element is smaller than the scrollport, and you want the full animation to occur fully, from beginning to end, as it enters or as it exits the scrollport, use `entry` or `exit`, respectively. If your animated element is larger than the viewport, the animation range is contained in the scrollport, while the element is not. The `entry` value sets the `100%` progress to be when the element's start edge reaches the start-edge of the scrollport, and `exit` only reaches the `0%` that is when the element's end-edge reaches the scroll container's end edge; when the animated element has already partially scrolled past the scrollport's start edge.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
If the animated element is smaller than the scrollport, and you want the full animation to occur fully, from beginning to end, as it enters or as it exits the scrollport, use `entry` or `exit`, respectively. If your animated element is larger than the viewport, the animation range is contained in the scrollport, while the element is not. The `entry` value sets the `100%` progress to be when the element's start edge reaches the start-edge of the scrollport, and `exit` only reaches the `0%` that is when the element's end-edge reaches the scroll container's end edge; when the animated element has already partially scrolled past the scrollport's start edge.
If the subject element is smaller than the scrollport, and you want the full animation to occur as it enters or exits the scrollport, you can happily use `entry` or `exit`, respectively. If your animated element is larger than the viewport, the animation range is contained in the scrollport, while the element is not. The `entry` value sets the `100%` progress to be when the element's start edge reaches the start-edge of the scrollport, and `exit` only reaches the `0%` that is when the element's end-edge reaches the scroll container's end edge; when the animated element has already partially scrolled past the scrollport's start edge.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first sentence makes sense in this paragraph. The rest of it is really difficult to parse. Try simplifying it a bit, and focusing more on high-level description rather than specifics?

Maybe something like "However, if your subject element is larger than the scrollport, entry and exit don't work so well. Respectively, the animation will stop when the subject's start edge first gets to the scrollport start edge or when he subject's end edge first gets to the scrollport end edge. In either case, you don't get to see all of the animation. In such cases, entry-crossing and exit-crossing are a better fit."


### Exit

The `exit-crossing` value represents the range during which the animated element crosses the start edge of the viewport, with `0%` progress occurring when the element's start edge aligns with the start edge the viewport and `100%` progress occurring when the element's end edge reaches the start edge of the viewport, meaning it starts animating as soon as it covers the viewport, and continues animating until it fully exits the viewport's start edge.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You've not included a graph to compare exit and exit-crossing, which is a shame, as the graph comparing entry and entry-crossing makes sense and is useful.

You've also not included any coverage of different ranges for entry-cross- or exit-crossing, e.g. the 30%/70% example. This seems inconsistent.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The insetting is a focus of a different guide. I'll be linking to that from this post when it's done. I've included it a few places in this post to link to that post later

@estelle estelle marked this pull request as draft January 28, 2026 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:CSS Cascading Style Sheets docs size/l [PR only] 501-1000 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants