Loading video...

Video Failed to Load

Go Home

Pinterest moved to native CSS carousels to replace legacy JS platform-wide → Using CSS primitives like scroll markers and snap, they achieved: 📉 90% code reduction (2k JS → 200 CSS) 🚀 15% faster page loads ✨ Smoother, interactive UI

220,423 views • 7 months ago •via X (Twitter)

31 Comments

Jacob Miller's profile picture
Jacob Miller7 months ago

Their carousel implementation isn't what I want native, it's this bad boy. Give us that sweet sweet display: grid-lanes!

Chrome for Developers's profile picture
Chrome for Developers7 months ago

It’s actively being worked on! Microsoft is adding the feature to Chromium. They are sweating the details to make sure the implementation is feature complete and spec compliant. ETA TBD.

Brandon McConnell's profile picture
Brandon McConnell7 months ago

dope! what are they using to polyfill for safari and firefox?

NoodLy's profile picture
NoodLy7 months ago

@grok pode explicar?

Chat Data's profile picture
Chat Data7 months ago

This is the kind of frontend progress people underestimate. Replacing custom JS with browser primitives usually buys you three things at once: less code to maintain, fewer edge-case bugs, and better runtime behavior. The 90 percent reduction is wild.

NoodLy's profile picture
NoodLy7 months ago

@grok explica de uma forma completa e tecnica

inna stahova's profile picture
inna stahova7 months ago

As far as I know, you still can’t make a looped (infinite) carousel with pure CSS where you can seamlessly swipe/scroll straight from the last slide directly to the first one.

Chrome for Developers's profile picture
Chrome for Developers7 months ago

That is correct at the moment. Is this something you would like to see in the future?

inna stahova's profile picture
inna stahova7 months ago

yes

Phillip.png ⚡🐢's profile picture
Phillip.png ⚡🐢7 months ago

@grok do all modern browsers support this?

Kiev Andres's profile picture
Kiev Andres7 months ago

@LeonidasEsteban Is this available for all modern browsers? 🤔

Chrome for Developers's profile picture
Chrome for Developers7 months ago

@LeonidasEsteban This is Chromium (Chrome, Edge, Brave) only … but the feature is part of the css-overflow-5 specification, so other browsers can implement it over time. People can resort to feature detection to provide alternatives in browsers with no support.

Kiev Andres's profile picture
Kiev Andres7 months ago

@LeonidasEsteban Got it! Thanks for clarifying. It's always exciting to see these new CSS capabilities landing in Chromium first. Looking forward to implementing this with proper fallbacks! 🔥

Paul's profile picture
Paul7 months ago

2k lines of JS replaced by 200 lines of CSS. The best code is the code you delete. Native web platform keeps closing the gap on frameworks.

Hakimuddin K's profile picture
Hakimuddin K7 months ago

So people are moving towards plain vanilla as the frameworks get bloated

Arif Hossain's profile picture
Arif Hossain7 months ago

Here is an example of native CSS carousel with polyfill.

The AI Index's profile picture
The AI Index7 months ago

Browsers are eating UI logic, less JS glue, more native primitives, this shifts complexity from apps into the platform layer

Chrome for Developers's profile picture
Chrome for Developers7 months ago

Spot on. Shifting that complexity down to the platform layer means the browser engine can optimize it at the C++ level, pushing animations and scrolling directly to the compositor thread.

Adrian T's profile picture
Adrian T7 months ago

Nice! What about RAM usage on this? One other thing people would probably like to see is more RAM optimization.

Debo's profile picture
Debo7 months ago

hah, wish I could create visuals like these :)

AI Dynamo aka Elon Wiki aka Elon's Guru's profile picture
AI Dynamo aka Elon Wiki aka Elon's Guru7 months ago

@grok Native CSS is here

Ty Zhao's profile picture
Ty Zhao7 months ago

save stuff locally instead of pinterest on

zaw min's profile picture
zaw min7 months ago

I'm very see.

Souhail Marghabi's profile picture
Souhail Marghabi7 months ago

@0xGorri

HuBrowser's profile picture
HuBrowser7 months ago

nice

Deokhyun's profile picture
Deokhyun7 months ago

The real win is shrinking the surface area, not just cutting JS.

Chrome for Developers's profile picture
Chrome for Developers7 months ago

Exactly! Swapping a heavy JS carousel for native CSS scroll-snap doesn't just save bytes over the wire, it completely removes that entire execution surface from the main thread.

Gogo | Azurox's profile picture
Gogo | Azurox7 months ago

Is native drag on desktop in scope for improvement? It has been a deal breaker on multiple project for adoption to replace Swiper

Abbos Nurgulshanov's profile picture
Abbos Nurgulshanov7 months ago

@teqqed

Josho Evancer's profile picture
Josho Evancer7 months ago

Hey... See

sprintfPython's profile picture
sprintfPython7 months ago

true industry got scammed by these middleware bloats in code

Related Videos