🍋
Menu
CSS

Scroll-Driven Animation

CSS Scroll-Driven Animation

Animations linked to scroll progress rather than time, enabling effects that respond to the user's scroll position.

Teknik Detay

CSS Scroll-Driven Animations animate property changes over a specified duration using easing functions (ease, linear, cubic-bezier). Only animatable properties can transition — layout properties like display and grid-template cannot. Performance-critical transitions should target transform and opacity, which run on the compositor thread without triggering layout recalculation. The will-change property hints the browser to optimize for upcoming transitions by promoting elements to their own compositing layer.

Ornek

```css
/* Example: Scroll-Driven Animation */
.element {
  /* Apply scroll driven animation to this element */
  display: block;
  margin: 0 auto;
}
```

Ilgili Araclar

Ilgili Terimler