---
title: "A guide to Scroll-driven Animations with just CSS"
description: "CSS scroll-driven animations, now supported in Safari 26 beta, tie keyframe animations to scroll position instead of time using the animation-timeline property, with no JavaScript required."
url: "https://swe.quest/articles/a-guide-to-scroll-driven-animations-with-just-css-4e60392ccf274304"
canonical: "https://webkit.org/blog/17101/a-guide-to-scroll-driven-animations-with-just-css/"
source: "WebKit"
published: "2025-06-20"
difficulty: "medium"
kind: "How-to"
reading_minutes: 9
tags: ["css","frontend","browsers","accessibility"]
---

# A guide to Scroll-driven Animations with just CSS

A post on [WebKit](https://swe.quest/sources/webkit.md), published 2025-06-20, 9 min read, How-to. Original: [https://webkit.org/blog/17101/a-guide-to-scroll-driven-animations-with-just-css/](https://webkit.org/blog/17101/a-guide-to-scroll-driven-animations-with-just-css/)

## Summary

CSS scroll-driven animations, now supported in Safari 26 beta, tie keyframe animations to scroll position instead of time using the animation-timeline property, with no JavaScript required. A scroll-driven animation combines a target, keyframes and a timeline: scroll() advances with the scroller's position (shown with a footer progress bar), while view() advances as an element moves through the viewport (shown with images sliding in). animation-range limits when along the timeline the animation runs, for example 0% 50% so images settle halfway up the viewport. Note that animation-timeline must be declared after the animation shorthand, and larger motion effects should be wrapped in a prefers-reduced-motion media query.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [CSS](https://swe.quest/tags/css.md) (Web & mobile)
- [Frontend](https://swe.quest/tags/frontend.md) (Web & mobile)
- [Browsers](https://swe.quest/tags/browsers.md) (Web & mobile)
- [Accessibility](https://swe.quest/tags/accessibility.md) (Web & mobile)

## Prerequisites

- CSS keyframe animations ([easy posts on CSS](https://swe.quest/tags/css.md?difficulty=easy))

## Keywords

Scroll-driven Animations, animation-timeline, animation-range, Safari 26, WebKit, prefers-reduced-motion

## Related posts

- [So many ranges, so little time: A cheatsheet of animation-ranges for your next scroll-driven animation](https://swe.quest/articles/so-many-ranges-so-little-time-a-cheatsheet-of-animation-ranges-for-your-next-18f675af06ca744a.md): WebKit · 2025-07-09 · Medium · 8 min read · CSS, Frontend, Browsers
  CSS \`animation-range\` controls exactly when a \`view()\`-timeline scroll-driven animation starts and stops relative to an element's position in the viewport.
- [Release Notes for Safari Technology Preview 234](https://swe.quest/articles/release-notes-for-safari-technology-preview-234-c61c7e32fab07eaa.md): WebKit · 2025-12-19 · Easy · 5 min read · Browsers, CSS, Frontend
  Safari Technology Preview 234 adds Threaded Scroll-driven Animations, which update opacity, transform, filter and Motion Path animations off the main thread as scrolling happens, for smoother results on ProMotion displays.
- [WebKit Features in Safari 26.0](https://swe.quest/articles/webkit-features-in-safari-26-0-4e0c3f282c06e21a.md): WebKit · 2025-09-15 · Medium · 40 min read · Browsers, CSS, Frontend, Mobile
  Safari 26.0 ships 75 new web features, 3 deprecations and 171 improvements, headlined by CSS Anchor Positioning (position-area, anchor(), position-try), scroll-driven animations, text-wrap: pretty, contrast-color() and the progress() function, with code examples for each.
- [Release Notes for Safari Technology Preview 227](https://swe.quest/articles/release-notes-for-safari-technology-preview-227-119e49c133d89d81.md): WebKit · 2025-09-03 · Easy · 5 min read · Browsers, CSS, Frontend, WebAssembly
  Safari Technology Preview 227 (WebKit 298484@main…299099@main) adds the Navigation API, the scrollend event, command/commandfor button attributes for declarative popover and dialog control, and CSS field-sizing, scrollbar-color, position-visibility and math-shift.
- [Two lines of Cross-Document View Transitions code you can use on every website today](https://swe.quest/articles/two-lines-of-cross-document-view-transitions-code-you-can-use-on-every-website-87eda278df990c07.md): WebKit · 2025-05-21 · Medium · 4 min read · CSS, Browsers, Frontend, Accessibility
  Adding \`@view-transition { navigation: auto; }\` to a site's CSS enables cross-document View Transitions, so elements shared between pages stay fixed and everything else crossfades instead of flashing blank between navigations.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
