Post

There’s a new type of CSS scroll-state query coming: “scrolled”. This one remembers the last direction you scrolled into, which you can use to build “hidey bars”: when scrolling down (or having scrolled down), the hidey bar hides itself. When then scrolling back up, the hidey bar reveals itself.

The code for the demo is attached to this post. Yes, it’s that easy! You can try it out yourself in Chrome Canary with the experimental Web Platform Features Flag enabled: codepen.io/bramus/pen/q... The feature is expected to ship to Chrome Stable in Chrome 144.

Oh do I recall correctly complaining to you two about some JS running on CSS wrapped last year on every scroll to make the dinosaur turn around? Guess that’s about to get a whole load easier with this!