Scroll-driven animations are Baseline: a reading progress bar and scroll reveals in pure CSS
Firefox 159 shipped on October 27, 2026 with scroll-driven animations turned on by default. Chrome has had them since version 115 and Safari since 26, so the feature is now Baseline Newly available: it works in the current version of every major browser.
That means two of the most common bits of "scroll JavaScript" on the web, a reading progress bar and fade-in-on-scroll cards, can now be plain CSS. No scroll listeners, no IntersectionObserver, and the animation runs off the main thread.
Here's how both work, the one ordering bug that catches almost everyone, and how to ship it safely.
Two new timelines
A normal CSS animation runs on the document timeline: time passes, the animation moves from the first keyframe to the last. Scroll-driven animations swap that clock using animation-timeline:
-
scroll()— progress goes from 0% to 100% as a scroll container scrolls from start to end. -
view()— progress follows an element as it travels through the visible area of its scroller.
Your keyframes stay exactly the same. Only the clock changes.
Pattern 1: a reading progress bar with scroll()
<div class="progress" aria-hidden="true"></div> .progress { position: fixed; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, #7c3aed, #06b6d4); transform-origin: 0 50%; transform: scaleX(0); } @supports (animation-timeline: scroll()) { .progress { animation: grow-progress linear both; animation-timeline: scroll(root block); } } @keyframes grow-progress { to { transform: scaleX(1); } } scroll(root block) means "the root scroller, on the block axis" (vertical, for most pages). Animating transform instead of width keeps it on the compositor, so it stays smooth even on a busy page.
Pattern 2: reveal cards as they enter with view()
@supports (animation-timeline: view()) { .card { animation: reveal linear both; animation-timeline: view(); animation-range: entry 0% cover 30%; } } @keyframes reveal { from { opacity: 0; transform: translateY(40px) scale(0.98); } to { opacity: 1; transform: none; } } animation-range controls where in the element's journey the animation plays. entry 0% is the moment the card's top edge appears; cover 30% is when it has moved 30% of the way through the viewport. After that, it simply stays visible.
The bug: shorthand order
This doesn't work:
/* ❌ animation-timeline gets reset */ .card { animation-timeline: view(); animation: reveal linear both; } The animation shorthand resets animation-timeline back to auto. So the shorthand has to come first, and animation-timeline after it. If your scroll animation "just plays once on load", this is almost always why.
Also note the linear easing and the missing duration: with a scroll timeline, progress is driven by scroll position, so a time-based duration doesn't mean anything here.
Shipping it safely
1. Treat it as an enhancement. "Newly available" means current browsers support it, not every user. People on older or pinned browser versions won't get the effect. Wrapping the animation in @supports (as above) makes sure they still see the content in its final state instead of stuck at opacity: 0.
2. Respect reduced motion.
@media (prefers-reduced-motion: reduce) { .card { animation: none; } } The progress bar is usually fine to keep, since it shows information rather than decoration, but movement like slide-ins should switch off.
3. Don't hide important content behind it. If a reveal fails for any reason, the content should still be readable. Keep the starting state in the keyframes, not in the base styles.
When you still need JavaScript
CSS covers the "map scroll position to an animation" case. You still want JS when scroll needs to trigger logic: loading more items, analytics events, or changing state based on which section is active.
But for progress bars, parallax-lite effects and reveal-on-scroll, you can probably delete a script today.
Live demo on CodePen: https://codepen.io/pouyamoradzad/pen/MYmZaBr
Sources: web-features explorer: Scroll-driven animations, MDN: CSS scroll-driven animations.
This article was generated with AI and checked against the sources above.