New Aug 26, 2024

Chris’ Corner: Gold Star CSS Bloggers

Company/Startup Blogs All from CodePen View Chris’ Corner: Gold Star CSS Bloggers on blog.codepen.io

CSS still gives me the warm fuzzies sometimes. We’ve gotten so many amazing CSS features the past few years, that each alone makes me happy. But when those features are combined, I’m often stunned and get thinking about how we’re only scratching the surface of what is to come.

Take a new demo by Adam Argyle “Responsive App Switcher”. If you happen to be an iOS user, you might recognize the look and feel from that interface where you swipe up and are choosing between recent open apps.

In this demo, Adam is using CSS grid layout, with the lesser-used grid-auto-flow to just let elements sit in a row and take the horizontal space they need. He uses scroll snapping so that each, let’s call them a “card”, snaps into a satisfying place. There is some bonus trickery with the snapping involving invisible cards at the beginning and end to make the final scrolling still have an elastic bouncy feeling. Things are sized with aspect-ratio and logical properties, and the overall container is literally a container such that sizing can be done with container units. The satisfying “shrink as it scrolls away” affect is done with scroll-driven animations, and styles are applied in layers just for good measure.

That’s a lot of modern CSS features.

Where my mind goes is: more! more! more!

Can’t you imagine each card being a blog post card instead? They could scroll a bit if needed, with a hero image that shrinks down with more Scroll-Driven Animations.

Can’t you imagine all the sizing and layout the elements inside each card being entirely handled by container units and container queries? Maybe some cards are differently sized depending on their importance and thus have unique layouts.

Can’t you imagine clicking on of those blog post cards and having View Transitions kick in and expand the card into a full-screen blog post?

Phew. We’re starting to see some stuff like that, but typically demos and less-so production websites. But we will soon. A lot of this stuff is perfectly in progressive-enhancement territory and support is probably better than you think it is and moving quickly.


I’ve got some great CSS links for you, many of which are aligned with the fancy and new I was just talking about.

Scroll to top