Detecting Scroll State with CSS

Modern CSS allows us to detect scroll behavior and apply styles without using JavaScript. In this example, we check whether the .container element is scrollable.