Skip to content

animation-range

Controls which portion of the timeline drives the animation. The most important utility to tune the feel of a scroll-driven effect.

Range keywords

KeywordMeaning
entryFrom the moment the element starts entering the viewport to fully entered.
exitFrom fully visible to fully out.
coverEntire traversal — entry + visible + exit.
containThe window during which the element is fully inside the viewport.
entry-crossingThe element's bottom crossing the viewport's bottom.
exit-crossingThe element's top crossing the viewport's top.

Shorthand

ClassCSS
anim-range-<keyword>animation-range: <keyword>
anim-range-[<value>]animation-range: <value>

Start / End

ClassCSS
anim-range-start-<keyword>animation-range-start: <keyword>
anim-range-end-<keyword>animation-range-end: <keyword>
anim-range-start-[<value>]arbitrary
anim-range-end-[<value>]arbitrary

Two-value syntax

For fine control, use the arbitrary form with both ends in one declaration. Underscores become spaces:

html
<!-- animate from "entry starts" to "25% into cover" → a slow, comfortable reveal -->
<div class="… timeline-view anim-range-[entry_0%_cover_25%]" />

Picking the right range

GoalRecommended range
Snap as soon as the element appearsanim-range-entry
Slow, dramatic reveal over more scroll distanceanim-range-[entry_0%_cover_30%]
Progress bar across the whole pageanim-range-cover on a timeline-scroll
Fade-out as the element leavesanim-range-exit
Animation runs only while element is fully shownanim-range-contain

Released under the MIT License.