Vanilla CSS in 2025 is super capable
An interesting question popped up today.
- a layout with a max-width container
- using a responsive grid for shared layout structure
- with a card slider
- the card slider needs scroll snapping,
- where the snapping conforms to the max-width container,
- but with visible overflow to the right and left,
- and the slides align to the grid layout
My first thought was: "This is what Swiper is for.", but then I thought: "maybe css can handle this." Turns out: yes, this is totally doable in css, and it's not even that complicated.
It was a really interesting brain-teaser. Here's the codepen: https://codepen.io/thisanimus/pen/dPbwebd
I feel like I'm having more and more of these moments where I realize I no longer need a js lib to do the thing I want to do. I like it. CSS FTW.