Menu

Post image 1
Post image 2
Post image 3
1 / 3
0

Chris’ Corner: Two Liners

CodePen·@HashtagPLUS·about 1 month ago
#tdSVOFyF
#docs#card#scroll#corners#remember#code
Reading 0:00
15s threshold

The real reason that fancy modern CSS is exciting is because of what we can now actually do in CSS. I remember one of my favorite dudes Hakim El Hattab made a thing called “Progress Nav” ten years ago. The idea is a Table of Contents component that could tell where you are scrolled in the page and reflects that in the design of the ToC. Perhaps you won’t be surprised that functionality works via JavaScript. It’s not horridly huge or complex , but, it does rely on totally-not-even-debounced window.addEventListener( 'scroll', ... which is known to be a cause of janky performance. But it’s cool, right?! This kind of thing has been come to be known as a “scroll spy” effect. I’m sure you can see where I’m going with this: CSS can do scroll spy now. In Chrome anyway. Remember when all that CSS carousel stuff was happening? This is highly related. I remember people gently trying to say this isn’t just CSS carousels, it’s interesting CSS primitives that combined can make a carousel, but totally have other users too.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More