Web Design

CSS Scroll-Driven Animations: A How-To Now That Chrome, Safari and Firefox All Support Them

An isometric low-poly 3D diorama of a small round wooden stage with a large hand crank mounted on its side, linked by a chain of gears to a faceted sun that rises along a curved track above the stage, a visual for CSS scroll-driven animations, where scrolling the page drives an animation forward instead of a clock

Scroll-driven animations in CSS now work in every major browser engine. Firefox 159 turned them on by default on October 27, 2026, joining Chrome and Edge 115 and Safari 26. A reading progress bar or a reveal-on-scroll effect no longer needs a JavaScript scroll listener or a library.

That matters for agencies maintaining WordPress and Drupal themes. Many sites still load a script just to fade cards in or grow a progress bar. This post explains how scroll-driven animations work and gives three short examples. It also shows a fallback for older browsers and the reduced-motion rule these effects need.

The short version: write a normal code>@keyframes</code animation. Then set animation-timeline to scroll() to tie it to page scroll, or to view() to tie it to an element moving through the viewport. Declare animation-timeline after the animation shorthand. Wrap motion in a prefers-reduced-motion check, and make sure content is visible when the animation does not run.

Browser support for scroll-driven animations, as of November 2026

Each browser vendor documents the release where the feature arrived.

Browser First version on by default Source
Chrome 115 (July 2023) Chrome’s “New in Chrome 115” post and scroll-driven animations guide
Edge 115 Support table in Chrome’s guide
Safari (macOS, iOS, iPadOS, visionOS) 26.0 (September 15, 2025) WebKit’s Safari 26.0 features post
Firefox 159 (October 27, 2026) MDN’s Firefox 159 release notes for developers

MDN’s Firefox 159 release notes say scroll-driven animations are "now enabled by default." WebKit’s Safari 26.0 post lists the feature with a view() example. Chrome’s New in Chrome 115 post introduced scroll and view timelines in 2023.

One caution. When we checked on November 2, 2026, MDN’s animation-timeline page and the web-features explorer still showed "Limited availability." That data had not caught up with Firefox 159. Expect the Baseline label to change.

Older Firefox builds, including Extended Support Release versions before 159, do not have the feature on. Our post on the end of Firefox ESR 140 explains why that version floor matters for client support policies.

How scroll-driven animations work

A normal CSS animation runs on a clock. You give it a duration, and it plays from 0% to 100% over that time. A scroll-driven animation swaps the clock for a scroll position.

Chrome’s scroll-driven animations guide describes two kinds of timeline.

  • Scroll progress timeline: "a timeline that is linked to the scroll position of a scroll container along a particular axis." Use scroll().
  • View progress timeline: "a timeline that is linked to the relative position of a particular element within its scroll container." Use view().

scroll() takes a scroller: nearest, root or self. It also takes an axis: block, inline, x or y. The defaults are nearest and block. view() takes an axis and an optional inset.

Two rules trip people up. First, the MDN reference for animation-timeline says the animation shorthand resets it to auto. So declare animation-timeline after the shorthand, or it will not take effect. Second, Chrome’s guide says a duration in seconds "does not make sense" on a scroll timeline. Set the duration to auto.

Example 1: a reading progress bar with scroll()

This bar grows across the top of the page as the reader scrolls. It follows the pattern in Chrome’s guide.

/* Grows from left to right. */
@keyframes grow-progress {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.reading-progress {
  /* Fixed to the top. */
  position: fixed;
  inset: 0 0 auto 0;
  height: 4px;
  background: #1a5fb4;
  transform-origin: 0 50%;
  animation: grow-progress auto linear;
  animation-timeline: scroll(root);
}

The scroll(root) value ties the bar to the whole document. Use scroll(nearest) instead if the article sits inside its own scrolling panel.

Example 2: reveal cards as they scroll into view with view()

This is the most common effect agencies build with JavaScript. With a view timeline, each card animates as it enters the viewport.

/* Fades and slides in. */
@keyframes reveal {
  from { opacity: 0; transform: translateY(2rem); }
  to { opacity: 1; transform: none; }
}

.card {
  /* Tied to the card's own position. */
  animation: reveal auto linear both;
  animation-timeline: view();
  animation-range: entry 0% cover 30%;
}

The animation-range line controls when the animation starts and finishes. Chrome’s guide lists the named ranges: cover, contain, entry, exit, entry-crossing and exit-crossing. Here the card starts fading in as it enters. It finishes 30% of the way through its full pass. MDN’s animation-range page shows the one to four value forms.

WebKit’s Safari 26 example uses the simpler animation-range: 0% 50%. Start simple and adjust while scrolling in each browser.

Example 3: a header that changes after the first scroll

A sticky header that gains a shadow after the reader scrolls a little is another common script. A length-based range handles it.

/* Adds a shadow. */
@keyframes header-raise {
  to { box-shadow: 0 2px 8px rgb(0 0 0 / 0.2); }
}

.site-header {
  /* Runs over the first 200px. */
  position: sticky;
  top: 0;
  animation: header-raise auto linear both;
  animation-timeline: scroll(root);
  animation-range: 0 200px;
}

The animation runs over the first 200 pixels of scroll and then holds its end state because of both.

Add scroll-driven animations safely with @supports

Browsers that do not know animation-timeline ignore it. What happens next depends on the rest of your CSS. The effect may play once on page load like a normal animation, or not at all. The worst case is a base style that hides the element until the reveal runs. A card stuck at opacity: 0 is a real problem.

The fix is to put the whole effect inside a feature query.

@supports (animation-timeline: view()) {
  .card {
    animation: reveal auto linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 30%;
  }
}

Browsers without support show the cards as plain content. For most sites that is the right fallback. Need the effect everywhere? Keep the old script and load it only when CSS.supports('animation-timeline: view()') returns false.

Our guide to browser engines in 2026 covers which engines to test. Our post on Chrome’s two-week release cycle covers how fast changes now reach users.

Respect prefers-reduced-motion with scroll-driven animations

Chrome’s scroll-driven animations guide does not mention motion sensitivity, and neither does WebKit’s Safari 26 example. Your code still has to handle it.

MDN’s prefers-reduced-motion page says the setting tells the browser the user "prefers an interface that removes, reduces, or replaces motion-based animations." It warns that "scaling or panning large objects can be vestibular motion triggers."

The W3C’s Understanding document for WCAG 2.3.3, Animation from Interactions is direct about scrolling. The criterion reads "Motion animation triggered by interaction can be disabled, unless the animation is essential." It names parallax scrolling as often non-essential. It also says that if scrolling causes elements to move, "it can trigger vestibular disorders." The W3C lists technique C39, using the prefers-reduced-motion query, as a way to meet it.

2.3.3 is a Level AAA criterion, so most compliance targets do not require it. It is still the clearest guidance on scroll-linked motion. Our web accessibility guide and WCAG 2.2 explainer cover the levels.

The simplest pattern is to opt in to motion only when the user has not asked for less.

@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .card {
      animation: reveal auto linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 30%;
    }
  }
}

With this, users who set reduced motion see the cards at full opacity in place. The reading progress bar does not move content, so you may keep it. The card reveal and any parallax effect should stay inside the media query.

Performance: why these can beat scroll listeners

Chrome’s guide explains the problem with the old approach. Scroll handlers run on the main thread, and "Main thread animations are subject to jank." Modern browsers scroll on a separate process and deliver scroll events asynchronously. The guide says the new APIs include "the ability to have scroll-driven animations run off the main thread."

For sites working on responsiveness, removing a scroll listener means less JavaScript competing with clicks and taps. Our posts on Core Web Vitals and fixing INP cover how to measure that.

Do not assume every scroll-driven animation is free. Test on a mid-range phone, and check the Performance panel in your browser’s developer tools.

Where to put scroll-driven animations in WordPress and Drupal themes

These are plain CSS, so they go wherever the theme’s styles live. In WordPress that is the theme stylesheet. In Drupal it is a library CSS file in the theme. There is no plugin or module to install.

A few practical points for agency work.

  • Use classes you control. Target a class added in the block editor’s Advanced panel or in a Twig template. Do not target generic selectors like section that editors cannot see.
  • Remove the old script. If the site loaded a reveal library, take it out once the CSS works.
  • Keep the effect light. Fades and small slides read well. Large movement is what reduced-motion users are asking to avoid.
  • Test in all three engines. Behavior around animation-range can differ slightly. Check Chrome, Safari and Firefox 159 or later.

Frequently Asked Questions

What are scroll-driven animations in CSS?

They are CSS animations whose progress follows a scroll position instead of time. You use the animation-timeline property with scroll() for page or container scroll, or view() for an element moving through the viewport.

Which browsers support scroll-driven animations?

Chrome and Edge 115 and later, Safari 26.0 and later, and Firefox 159 and later, per each vendor’s release notes. Firefox turned the feature on by default on October 27, 2026.

Why does my scroll-driven animation not run?

The most common cause is declaring animation-timeline before the animation shorthand. MDN says the shorthand resets it to auto, so put animation-timeline after it. Also set the duration to auto.

What is the difference between scroll() and view()?

scroll() follows the scroll position of a scroll container, such as the whole page. view() follows one element’s position as it passes through its scroll container’s visible area.

Do I still need JavaScript for scroll effects?

Not for common effects like progress bars, reveal-on-scroll and header changes. You may keep a script as a fallback for browsers without support, loaded only when the CSS feature check fails.

How do I make scroll-driven animations accessible?

Wrap motion in @media (prefers-reduced-motion: no-preference) so users who ask for less motion do not get it. Make sure content is fully visible when the animation does not run.

Is WCAG 2.3.3 required for compliance?

It is a Level AAA criterion, and most compliance targets use Level AA. The W3C’s guidance on scroll-triggered motion is still worth following.

Are scroll-driven animations Baseline yet?

When we checked on November 2, 2026, MDN and the web-features explorer still listed them as limited availability. That data had not caught up with Firefox 159, so expect the label to change.

Digital Matters

Web Design Desk