Conditional Snapping With Has
Adam Argyle
December 19, 2022
html :has ( .CertainItem:focus-visible ) { scroll-snap-type : y mandatory ; scroll-padding-block-start : 100 px ; } .CertainItem:focus-visible { scroll-snap-align : start ; } On demand with :has() , when a certain item is focused.. snap dat item into a nice position .
Discussion in the ATmosphere