Rebuilding a reverse-column scroll effect with native CSS scroll timelines
Mary Lou's Alternate Column Scroll demo is the reference point: the middle column scrolls naturally while the two outer columns move in the opposite direction. In its original form the effect is driven by Locomotive Scroll. Bramus set out to reproduce the scrolling behaviour natively, using the still-emerging CSS Scroll-Timeline feature.
Scroll-linked animation in CSS is early-stage — @scroll-timeline is behind a flag in Chrome — but the technique can be brought to browsers today with a polyfill and a little Web Animations API (WAAPI) glue. Bramus's four-part series on the subject covers the feature in depth, and earlier write-ups here have explored practical uses of scroll-linked animations, including combining scroll timelines with WAAPI. His rebuild of the demo is available on CodePen.

Respecting motion preferences
Reversed column movement is exactly the kind of motion that can trouble people with motion sickness, so the effect should be gated behind prefers-reduced-motion. In JavaScript, the support check and the preference check can be combined on a single line:
if (
!CSS.supports("animation-timeline: foo") &&
!window.matchMedia('(prefers-reduced-motion: reduce)').matches
) {
// Do fancy stuff
}
Whether to test for no-preference or for the absence of reduce is an open question. In CSS, the pattern is to nest tests: put everything that uses @scroll-timeline and animation-timeline inside an @supports block (which also gives you a branch for browsers without support), and wrap that in the preference test.
@media (prefers-reduced-motion: no-preference) {
@supports (animation-timeline: works) {
/* Do fancy stuff */
}
}
Cleaner once @when lands
The nesting gets considerably tidier if the proposed @when feature ships.
@when supports(animation-timeline: works) and media(prefers-reduced-motion: no-preference) {
} @else {
}


