scroll-timeline-axis CSS property

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

The scroll-timeline-axis CSS property is used to specify the scrollbar direction that will be used to provide the timeline for a scroll driven animation, which is progressed through by scrolling a scrollable element (scroller).

Syntax

css
/* Logical property values */
scroll-timeline-axis: block;
scroll-timeline-axis: inline;

/* Physical property values */
scroll-timeline-axis: y;
scroll-timeline-axis: x;

/* Global values */
scroll-timeline-axis: inherit;
scroll-timeline-axis: initial;
scroll-timeline-axis: revert;
scroll-timeline-axis: revert-layer;
scroll-timeline-axis: unset;

Values

<axis>

An <axis> keyword value describing the direction, or axis, of the scrollport that controls the scroll-driven animation. The default value is block.

Description

The scroll-timeline-axis property specifies which scrollbar will be used to provide the timeline for a scroll progress timeline animation. The value is the <axis> of the scrollbar. The scroll-timeline property is set on the scroller that will provide the timeline.

If the scroller element does not overflow its container in the axis dimension or if the overflow is hidden or clipped, no scroll progress timeline will be created.

The scroll-timeline-axis and scroll-timeline-name properties can also be set using the scroll-timeline shorthand property.

Formal definition

Initial valueblock
Applies toscroll containers
Inheritedno
Computed valueas specified
Animation typeNot animatable

Formal syntax

scroll-timeline-axis = 
[ block | inline | x | y ]#

Examples

Defining the axis of the scroll progress timeline

In this example, a scroll progress timeline named --my-scroller is defined using the scroll-timeline-name property on the :root element (<html>). This timeline is then applied to the animation on the element with the animation class using animation-timeline: --my-scroller.

To demonstrate the effect of scroll-timeline-axis, a horizontal (non-default) scrollbar is used in this example to drive the animation.

HTML

The HTML for the example is shown below.

html
<body>
  <div class="content"></div>
  <div class="box animation"></div>
</body>

CSS

The CSS for the container sets the :root as the source of a scroll progress timeline named --my-scroller using the scroll-timeline-name property. The scroll axis is set using scroll-timeline-axis: x; which causes the horizontal scrollbar position to determine the animation timeline. We also include scroll-timeline-axis: horizontal; for browsers that support the non-standard legacy horizontal and vertical values and not x and y.

The width of the .content element is set to a large value to make it overflow the :root element.

The .animation element has the animation applied to it using the animation shorthand, and the scroll timeline set using the animation-timeline.

css
:root {
  scroll-timeline-name: --my-scroller;

  scroll-timeline-axis: x;
  scroll-timeline-axis: horizontal;
}

body {
  margin: 0;
  overflow-y: hidden;
}

.content {
  height: 100vh;
  width: 2000px;
}

.box {
  width: 100px;
  height: 100px;
  border-radius: 10px;
  background-color: rebeccapurple;
  position: fixed;
  top: 25px;
  left: 25px;
}

.animation {
  animation: rotate-appear 1ms linear;
  animation-timeline: --my-scroller;
}

@keyframes rotate-appear {
  from {
    rotate: 0deg;
    top: 0%;
  }

  to {
    rotate: 720deg;
    top: 100%;
  }
}

Result

Scroll the horizontal bar at the bottom to see the square animate as you scroll.

Specifications

Specification
Scroll-driven Animations
# propdef-scroll-timeline-axis

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
scroll-timeline-axis
Chrome – Full support
Chrome 115 (Release date: 2023-07-18)
footnote Full support
Edge – Full support
Edge 115 (Release date: 2023-07-21)
footnote Full support
Firefox – No support
Firefox 111 (Release date: 2023-03-14)
footnote , disabled
disabled From version 111 users must explicitly set the layout.css.scroll-driven-animations.enabled preference to true. To change preferences in Firefox, visit about:config.
footnote The syntax of the shorthand property uses the fixed order of name and then the axis.
footnote Supports the deprecated horizontal and vertical values, and not the x and y values.
footnote The @scroll-timeline at-rule is replaced with the longhand properties scroll-timeline-name and scroll-timeline-axis and the shorthand property scroll-timeline.
Opera – Full support
Opera 101 (Release date: 2023-07-26)
footnote Full support
Safari – Full support
Safari 26 (Release date: 2025-09-15)
footnote Full support
Chrome Android – Full support
Chrome Android 115 (Release date: 2023-07-21)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Full support
Opera Android 77 (Release date: 2023-08-31)
footnote Full support
Safari on iOS – Full support
Safari on iOS 26 (Release date: 2025-09-15)
footnote Full support
Samsung Internet – Full support
Samsung Internet 23 (Release date: 2023-10-18)
footnote Full support
WebView Android – Full support
WebView Android 115 (Release date: 2023-07-21)
footnote Full support
WebView on iOS – Full support
WebView on iOS 26 (Release date: 2025-09-15)
footnote Full support
block
Chrome – Full support
Chrome 115 (Release date: 2023-07-18)
footnote Full support
Edge – Full support
Edge 115 (Release date: 2023-07-21)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 101 (Release date: 2023-07-26)
footnote Full support
Safari – Full support
Safari 26 (Release date: 2025-09-15)
footnote Full support
Chrome Android – Full support
Chrome Android 115 (Release date: 2023-07-21)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Full support
Opera Android 77 (Release date: 2023-08-31)
footnote Full support
Safari on iOS – Full support
Safari on iOS 26 (Release date: 2025-09-15)
footnote Full support
Samsung Internet – Full support
Samsung Internet 23 (Release date: 2023-10-18)
footnote Full support
WebView Android – Full support
WebView Android 115 (Release date: 2023-07-21)
footnote Full support
WebView on iOS – Full support
WebView on iOS 26 (Release date: 2025-09-15)
footnote Full support
inline
Chrome – Full support
Chrome 115 (Release date: 2023-07-18)
footnote Full support
Edge – Full support
Edge 115 (Release date: 2023-07-21)
footnote Full support
Firefox – No support
Firefox
footnote
footnote See bug 1676779
Opera – Full support
Opera 101 (Release date: 2023-07-26)
footnote Full support
Safari – Full support
Safari 26 (Release date: 2025-09-15)
footnote Full support
Chrome Android – Full support
Chrome Android 115 (Release date: 2023-07-21)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote
footnote See bug 1676779
Opera Android – Full support
Opera Android 77 (Release date: 2023-08-31)
footnote Full support
Safari on iOS – Full support
Safari on iOS 26 (Release date: 2025-09-15)
footnote Full support
Samsung Internet – Full support
Samsung Internet 23 (Release date: 2023-10-18)
footnote Full support
WebView Android – Full support
WebView Android 115 (Release date: 2023-07-21)
footnote Full support
WebView on iOS – Full support
WebView on iOS 26 (Release date: 2025-09-15)
footnote Full support
x
Chrome – Full support
Chrome 115 (Release date: 2023-07-18)
footnote Full support
Edge – Full support
Edge 115 (Release date: 2023-07-21)
footnote Full support
Firefox – No support
Firefox
footnote
footnote See bug 1676779
Opera – Full support
Opera 101 (Release date: 2023-07-26)
footnote Full support
Safari – Full support
Safari 26 (Release date: 2025-09-15)
footnote Full support
Chrome Android – Full support
Chrome Android 115 (Release date: 2023-07-21)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote
footnote See bug 1676779
Opera Android – Full support
Opera Android 77 (Release date: 2023-08-31)
footnote Full support
Safari on iOS – Full support
Safari on iOS 26 (Release date: 2025-09-15)
footnote Full support
Samsung Internet – Full support
Samsung Internet 23 (Release date: 2023-10-18)
footnote Full support
WebView Android – Full support
WebView Android 115 (Release date: 2023-07-21)
footnote Full support
WebView on iOS – Full support
WebView on iOS 26 (Release date: 2025-09-15)
footnote Full support
y
Chrome – Full support
Chrome 115 (Release date: 2023-07-18)
footnote Full support
Edge – Full support
Edge 115 (Release date: 2023-07-21)
footnote Full support
Firefox – No support
Firefox
footnote
footnote See bug 1676779
Opera – Full support
Opera 101 (Release date: 2023-07-26)
footnote Full support
Safari – Full support
Safari 26 (Release date: 2025-09-15)
footnote Full support
Chrome Android – Full support
Chrome Android 115 (Release date: 2023-07-21)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote
footnote See bug 1676779
Opera Android – Full support
Opera Android 77 (Release date: 2023-08-31)
footnote Full support
Safari on iOS – Full support
Safari on iOS 26 (Release date: 2025-09-15)
footnote Full support
Samsung Internet – Full support
Samsung Internet 23 (Release date: 2023-10-18)
footnote Full support
WebView Android – Full support
WebView Android 115 (Release date: 2023-07-21)
footnote Full support
WebView on iOS – Full support
WebView on iOS 26 (Release date: 2025-09-15)
footnote Full support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
See implementation notes.
User must explicitly enable this feature.

See also