A guide to Scroll-driven Animations with just CSS
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.
Related posts
- So many ranges, so little time: A cheatsheet of animation-ranges for your next scroll-driven animation
WebKit mediumAdeptCSS `animation-range` controls exactly when a `view()`-timeline scroll-driven animation starts and stops relative to an element's position in the viewport. The six timeline-range-name values are cover, contain, entry, entry-crossing, exit and exit-crossing, each illustrated with a sliding-image example. The crossing variants differ from entry and exit mainly when the element is taller than the viewport. Range names can be combined as start/end pairs (e.g. `contain exit`) and offset with length-percentage values; when omitted, the defaults are entry 0% to exit 100%.
- Release Notes for Safari Technology Preview 234
WebKit easyNoviceSafari 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. New CSS layout features include `display: grid-lanes`, an automatic `grid-auto-flow` initial value and `item-tolerance` for masonry. Web API additions cover ReadableStream async iteration, readable byte streams as fetch bodies, the Keyboard Lock API, scoped custom element registries, the WebAuthn PRF extension, and multi-microphone getUserMedia capture. Fixes span table and grid layout, MathML, SVG parsing, Media Source Extensions, Intl and Web Inspector.
- WebKit Features in Safari 26.0
WebKit mediumAdeptSafari 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. On iOS and iPadOS 26 every site added to the Home Screen now opens as a web app by default, with no manifest required. Other additions include HDR images with the dynamic-range-limit property, the <model> element and immersive video via HLS on visionOS, the Digital Credentials API, WebGPU, and WebKit in SwiftUI. Note that progress() does not clamp, so values can fall below 0% or exceed 100%.
- Release Notes for Safari Technology Preview 227
WebKit easyNoviceSafari 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. Anchor positioning now remembers the last successful position-try fallback and supports pseudo-elements. WebAssembly gains Memory toFixedLengthBuffer()/toResizableBuffer(). Fixes cover Animation.commitStyles(), anchor() in grid, CSP nonce handling for preload headers, storage access inheritance for WebSockets, and SVG spec conformance.
- Two lines of Cross-Document View Transitions code you can use on every website today
WebKit mediumAdeptAdding `@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. A simple crossfade doesn't introduce motion and generally needn't be disabled under `prefers-reduced-motion`. Support covers Safari 18.2, Chrome 126 and Edge 126 (about 85% of users), and unsupported browsers simply ignore the rule, making it a safe progressive enhancement.