Scroll-Driven Animation and Motion UX in 2026

Scroll-Driven Animation and Motion UX

CSS scroll-driven animations can now replace many JavaScript scroll-tied effects — scroll-timeline, view-timeline, production patterns, and the static and reduced-motion fallbacks.

CSS scroll-driven animations can now replace many of the JavaScript scroll-tied effects that used to live in Intersection Observer code or in libraries like ScrollTrigger. The animation-timeline: scroll() property ties an animation to scroll position; animation-timeline: view() ties it to element visibility. Chrome 115 shipped in July 2023, Safari 26 followed in September 2025, and Firefox 159 enabled it by default on October 27, 2026, so as of Nov 2026 the feature is Baseline Newly available (per web-features). Reading progress bars, sticky-then-compressing headers, and reveal-on-entry are patterns that cover many production uses. Parallax stays sparing, honoring the prefers-reduced-motion query should be treated as a design commitment (using it is one of the sufficient techniques W3C lists for WCAG 2.3.3, a Level AAA criterion), and a static fallback still matters for browsers without the feature, such as Firefox releases before 159.

For most of the 2010s, scroll-tied animation meant JavaScript. A page would listen for scroll events, calculate where the user was in the document, and update keyframe progress by hand. Performance was a constant fight — work happened on the main thread, frame drops were normal on slower devices, and a careless implementation could lock up an entire page. Intersection Observer shipped in Chrome in 2016, reached all major engines by 2019, and made the visibility part cheaper, but the timeline part — the actual tying of animation progress to scroll — still ran in JavaScript.

CSS scroll-driven animations changed that. The animation declaration stays the same; a single new property — animation-timeline — tells the browser to advance the animation against scroll position or element visibility instead of against wall-clock time. When the animation touches only compositor-friendly properties such as transform and opacity, the browser can run it off the main thread, and an effect that used to need a scroll listener, position math, and often a library dependency becomes a few lines of CSS.

This article is the working reference for that transition, with the caveat that the feature only became Baseline Newly available in October 2026, when Firefox 159 enabled it by default, so a static fallback is still needed for older browser versions.

Why scroll-driven animation moved to CSS

The old approach is worth naming, because some of its assumptions still leak into modern implementations. A scroll-tied animation in JavaScript needed three things — a scroll event listener, a calculation of position relative to a target, and an update to inline styles or a CSS variable on every tick. Even with requestAnimationFrame smoothing the updates, work landed on the main thread, and a heavy enough page would drop frames during the part of the experience the team most wanted to feel smooth.

The new approach moves the timeline into CSS. The animation is declared with @keyframes as before; the new property animation-timeline accepts scroll() or view() as a value and tells the browser to advance the animation against scroll progress instead of against time. When the keyframes animate only properties the compositor can handle, chiefly transform and opacity, the work can happen off the main thread on the compositor, the same place transform and opacity animations have lived for a decade, and frames stay smooth. Properties that trigger layout or paint, such as padding, width, or font-size, still cost main-thread work on every frame, as the web.dev article on animations and performance explains. Safari moved scroll-driven animations onto the compositor thread in Safari 26.4.

Browser support as of Nov 2026 covers all three evergreen engines. Chrome shipped scroll-driven animations in version 115 in July 2023; Safari followed in version 26 in September 2025; Firefox enabled them by default in version 159 on October 27, 2026. That makes the feature Baseline Newly available, not yet Widely available (per web-features), and the gap in older browser versions matters for fallback strategy — any site that ships scroll-driven animations also needs to ship a static version that works without them.

The W3C Scroll-driven Animations Level 1 specification covers the syntax in detail. The two timeline functions that matter in practice are scroll() and view().

scroll-timeline: progress tied to scroll position

animation-timeline: scroll() ties an animation's progress to the scroll position of a scrolling container. As the user scrolls from the top to the bottom of the container, the animation runs from start to end. The mapping is linear and direct — no JavaScript, no listener, no frame-by-frame update.

The canonical use case is a reading progress bar at the top of a long article.

css
@keyframes grow-progress {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--color-accent);
  transform-origin: 0 50%;
  animation: grow-progress linear;
  animation-timeline: scroll(root block);
}

Three details. First, scroll(root block) says use the root scroller and the block axis — that means vertical scroll on a normal document. Both axes are supported. Second, the keyframe duration is implicit — the animation runs from the start to the end of the scroll, not over a wall-clock duration. Third, animation-timing-function: linear is usually the right choice because scroll input is already continuous; easing on top makes the relationship between scroll and progress feel uneven.

Named scroll timelines let multiple elements share a single timeline, which is useful when several elements should animate against the same scrolling region. The container declares scroll-timeline-name, and any animated descendant references it with animation-timeline.

view-timeline: progress tied to element visibility

animation-timeline: view() ties an animation's progress to an element's visibility in its nearest scroll container (the viewport, for a page-level scroll). The animation starts when the element enters that scrollport and finishes when it leaves. This covers a frequent Intersection Observer use case — the one where the goal was to fade or transform an element as it entered the screen.

The canonical use case is an image reveal as the user scrolls.

css
@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal-on-scroll {
  animation: reveal linear both;
  animation-timeline: view();
  animation-range: entry 20% cover 40%;
}

The animation-range property is the part that takes a little learning. It accepts two values — the range start and end — expressed as ranges along the element's transit through its scrollport (the viewport, for a page-level scroll). entry 0% is the moment the element first touches the scrollport; entry 100% is the moment it has fully entered (or, for an element larger than the scrollport, has filled it). cover 0% is the same as entry 0%, and cover 100% is the same as exit 100%, the moment the element has fully left; the contain range starts at entry 100% and ends at exit 0%. exit 0% to exit 100% covers the element leaving. The defaults work — animation-range: cover runs the animation across the full transit — but explicit ranges give you precise control over when the animation starts and ends.

Named view timelines work the same way as scroll timelines. An element declares view-timeline-name, and that element and its descendants can reference it with animation-timeline; to drive an element outside that subtree, such as a sibling, declare the name with timeline-scope on a shared ancestor. This pattern is useful for coordinated reveals — for example, a heading that animates in based on the visibility of the section below it rather than itself, which needs timeline-scope when the heading sits outside that section.

Common scroll-driven patterns

A handful of patterns cover many production uses of scroll-driven animation; the catalog below lists them.

PatternTimelineWhen to use
Reading progress bar`scroll()` on rootLong-form articles where progress is meaningful
Hero scale or fade`view()` on hero elementMarketing pages with a single hero
Sticky header compression`scroll()` with `animation-range` earlyProduct UI where header takes too much space when scrolling
Reveal on entry`view()` with `entry` rangeList items, cards, image galleries
Horizontal scroll narrative`scroll()` on horizontal container, axis = inlineEditorial storytelling pages

Two patterns warrant a closer look. The sticky header compression — a header that starts tall with full branding and compresses to a thin bar as the user scrolls — used to require a scroll listener and conditional class toggles. With scroll-driven animation, it becomes a single keyframe animation with animation-timeline: scroll() and a short animation-range near the top.

css
@keyframes compress-header {
  from {
    padding: 24px 0;
    font-size: 1.5rem;
  }
  to {
    padding: 8px 0;
    font-size: 1rem;
  }
}

.site-header {
  position: sticky;
  top: 0;
  animation: compress-header linear both;
  animation-timeline: scroll(root block);
  animation-range: 0 200px;
}

This example animates padding and font-size, which trigger layout, so it runs on the main thread even though no JavaScript is involved. Keep the header's DOM small, or animate transform: scale() on an inner element if the compressing effect needs to stay off the main thread.

The reveal-on-entry pattern — list items fading and translating up as they enter the viewport — was historically a frequent use of Intersection Observer. The scroll-driven CSS version needs far less code, and because it animates only opacity and transform, it can run off the main thread. The pattern reference site at scroll-driven-animations.style collects more variants with copyable examples.

Parallax: use sparingly

Parallax is easy to do badly. Done well, it adds depth and a sense that the page has layers. Done badly, it reads as broken — text drifting away from its background, hero images that never quite settle, frames dropping on slow GPUs because every scroll event triggers compositor work on many separate layers.

Three rules keep parallax in the working range. First, keep the parallax movement subtle — as a rule of thumb rather than a published threshold, a small fraction of the scroll distance. For example, a background that moves ten pixels while the foreground moves a hundred reads as depth; a background that moves fifty pixels reads as the page coming apart. Second, test on slow GPUs. Recording the page in the Chrome DevTools Performance panel with CPU throttling on, while scrolling, can surface parallax frame drops that look fine on a desktop developer machine. Third, always place parallax behind text content, never over interactive elements. A button that moves at half the scroll speed of the cursor is hard to hit.

Many editorial pages do not need parallax at all, and honoring reduced motion, covered below, narrows the case further.

Honoring reduced motion

Treat honoring the prefers-reduced-motion: reduce query as a design commitment for any motion that does not carry essential signal. Users turn the preference on through operating system accessibility settings, and the browser exposes it to CSS. The query has been supported across browsers since January 2020 and the platform gives you a way to honor it.

WCAG 2.3.3 Animation from Interactions is a Level AAA success criterion: it requires that motion animation triggered by interaction can be disabled unless the animation is essential. W3C does not recommend requiring Level AAA conformance as a general policy for entire sites, but 2.3.3 speaks directly to motion animation triggered by interaction. Scroll counts as interaction, and the Understanding document names parallax scrolling as a typical non-essential animation. To reduce the chances of triggering vestibular disorders, the Understanding document says to choose any one of three solutions — avoid unnecessary animation, provide a control to turn off non-essential animations from user interaction, or take advantage of the reduce-motion feature in the user agent or operating system — and the pattern below takes the third route, a fallback path for when reduced motion is preferred.

css
.reveal-on-scroll {
  animation: reveal linear both;
  animation-timeline: view();
}

@media (prefers-reduced-motion: reduce) {
  .reveal-on-scroll {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

The pattern is two parts. Inside the media query, neutralize the animation and make the element appear in its final state — opacity one, no transform. The user still gets the content; they just do not get the animated transition into it. The same pattern works for parallax — disable the timeline-driven transform inside the reduce-motion query and let the background sit still.

The MDN reference on the prefers-reduced-motion query covers test methods. Both Chrome and Safari let you toggle the query in browser developer tools without changing OS settings — under the Rendering tab in Chrome DevTools, under User Preference Overrides in the Elements tab of Safari's Web Inspector. Walking a scroll-driven page with the toggle on is a direct way to catch motion that the query did not cover.

Phase 1 deliverables and acceptance criteria

Audit the JavaScript scroll listeners and Intersection Observer instances in the codebase. Many reveal-on-entry effects can move to animation-timeline: view(), and many scroll-tied transforms to animation-timeline: scroll(), with less code. The ones that cannot — anything that triggers side effects on scroll like analytics events, video play, or focus changes — should stay in JavaScript, but the visual part can usually peel off.

Decide on a static fallback for every scroll-driven animation. Browser versions released before support landed (for example, Firefox before version 159, released October 27, 2026) do not run it by default, and in every browser the reduced-motion rule above turns the animation off for users who prefer reduced motion. The element should look right when the animation never runs — at its final state, fully visible, no leftover hidden styles. The test is simple — disable the animation in browser developer tools and reload the page; if the content disappears, the fallback is wrong.

Pick the one scroll-driven animation that users see most often — usually a reading progress bar or a reveal-on-entry — and try moving it to CSS scroll-driven animation. The CSS is short enough to fit alongside the existing JavaScript while you compare them. Frame consistency on the throttled mobile profile is a simple metric to compare.

Walk the site with reduce-motion enabled. Anything still animating on scroll is a bug, with the narrow exception of functional motion like a static fallback that fades from one state to another over a few frames. On a site with no other way to turn it off, decorative scroll motion that survives the toggle does not meet WCAG 2.3.3 (Level AAA).

Scroll-driven animation in CSS is one of the rare cases where the new platform feature is both meaningfully simpler and, when it sticks to compositor-friendly properties, meaningfully more performant than the JavaScript pattern it replaces. The pattern catalog is small because many production needs come down to four or five effects. Treat honoring reduced motion as a design commitment. Older browser versions still lack support, and the fallback path matters as much as the animation itself.

Project Inquiry