正在加载视频...

视频加载失败

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 次观看 • 7 个月前 •via X (Twitter)

31 条评论

Jacob Miller 的头像
Jacob Miller7 个月前

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 的头像
Chrome for Developers7 个月前

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 的头像
Brandon McConnell7 个月前

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

NoodLy 的头像
NoodLy7 个月前

@grok pode explicar?

Chat Data 的头像
Chat Data7 个月前

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 的头像
NoodLy7 个月前

@grok explica de uma forma completa e tecnica

inna stahova 的头像
inna stahova7 个月前

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 的头像
Chrome for Developers7 个月前

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

inna stahova 的头像
inna stahova7 个月前

yes

Phillip.png ⚡🐢 的头像
Phillip.png ⚡🐢7 个月前

@grok do all modern browsers support this?

Kiev Andres 的头像
Kiev Andres7 个月前

@LeonidasEsteban Is this available for all modern browsers? 🤔

Chrome for Developers 的头像
Chrome for Developers7 个月前

@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 的头像
Kiev Andres7 个月前

@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 的头像
Paul7 个月前

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 的头像
Hakimuddin K7 个月前

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

Arif Hossain 的头像
Arif Hossain7 个月前

Here is an example of native CSS carousel with polyfill.

The AI Index 的头像
The AI Index7 个月前

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

Chrome for Developers 的头像
Chrome for Developers7 个月前

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 的头像
Adrian T7 个月前

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

Debo 的头像
Debo7 个月前

hah, wish I could create visuals like these :)

AI Dynamo aka Elon Wiki aka Elon's Guru 的头像
AI Dynamo aka Elon Wiki aka Elon's Guru7 个月前

@grok Native CSS is here

Ty Zhao 的头像
Ty Zhao7 个月前

save stuff locally instead of pinterest on

zaw min 的头像
zaw min7 个月前

I'm very see.

Souhail Marghabi 的头像
Souhail Marghabi7 个月前

@0xGorri

HuBrowser 的头像
HuBrowser7 个月前

nice

Deokhyun 的头像
Deokhyun7 个月前

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

Chrome for Developers 的头像
Chrome for Developers7 个月前

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 的头像
Gogo | Azurox7 个月前

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 的头像
Abbos Nurgulshanov7 个月前

@teqqed

Josho Evancer 的头像
Josho Evancer7 个月前

Hey... See

sprintfPython 的头像
sprintfPython7 个月前

true industry got scammed by these middleware bloats in code

相关视频