r/webdev • u/techie_e • 3h ago
Article GitHub Ditches CSS-in-JS for CSS Modules, Reports 55% Faster SSR after Three-Year Migration
https://www.infoq.com/news/2026/11/github-css-migration/
118
Upvotes
87
u/allurb4se 2h ago
CSS-in-JS always felt like weird to me. Having to convince my then CTO and the senior developer that it made very little sense was a painful and fruitless endeavor
35
u/Nervous-Toe5784 2h ago
The SSR gain makes sense since runtime libs like styled-components or emotion have to serialize and inject styles on every render, and they also need client-side context which doesn't play well with React Server Components. CSS Modules get extracted at build time, so the server just ships static class names and a plain stylesheet. If anyone misses the co-location, zero-runtime options like vanilla-extract or Panda CSS give you most of the DX without the render cost.
22
u/kisaragihiu 2h ago
article being reported on: https://github.blog/engineering/architecture-optimization/improving-site-performance-by-shipping-more-css/
9
u/captain_obvious_here back-end 33m ago
I still don't understand how people could think CSS-in-JS was a good idea, and solved anything regular CSS struggled with.
And now it's deep into projects, it probably costs a fortune to migrate out of this.
15
u/LieNaive4921 2h ago
Three-YEAR migration???
5
u/VayuAir 2h ago
I am glad the AI era has forced SSR back in focus. I always thought CSR was janky way of doing things
3
u/Ronin-s_Spirit 1h ago
Both before and after are fucking stupid. From the very beginning they could've had css files for each url route + generic css. Scoping issue in CSS is a skill issue, CSS classes and custom HTML tags have been around for a long time now.
1
u/ringsushy 30m ago
Three years sounds slow until you're ripping runtime styles out of a huge component library without breaking every page.