With Chrome 144, we now have "scroll-state(scrolled)," a container query that allows styling based on user scroll activity. Every time we replace JavaScript with pure CSS, it's a triumph.
una.im/scroll-stat...
Style based on scroll direction with this new scroll-state query feature.