Lexicon / Scroll behaviour · 6 of 11

19 / Scroll behaviour

Snapped State Query

Whichever slide is parked at the centre knows it is the one you are looking at, and lights up.

also called snapped detection · active-slide styling · scroll-state(snapped)

The companion query. A carousel always needed to know which slide is current, and every hand-rolled version computed it from offsets and got the edges wrong. This is the browser answering the question itself.

How it is builtscroll-snap-align: center; @container scroll-state(snapped: block) { … }
scroll inside ↓