r/css • • 1d 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/
139 Upvotes

12 comments sorted by

59

u/jonassalen 1d ago • Bravo

Is that a surprise? CSS-in-JS was a bad idea to begin with. 

9

u/One-Butterfly-9752 1d ago

It always upset me

7

u/minmidmax 1d ago

Yeah, it was always a bullshit idea. At least people are coming around on it!

16

u/_HMCB_ 1d ago

Why is everything so complex nowadays. 😣

9

u/kekeagain 1d ago

I think as CSS continues moving forward in scoping, relational styling, programmatic constructs, and with AI making the "tedious" bits like naming moot, I think people will being asking if the Tailwind and CSS-in-JS abstraction layer is relevant today.

9

u/gajus0 8h ago

CSS-in-JS is not the issue here.

https://github.com/bamboocss/bamboo

Bamboo is an example of CSS-in-JS that compiles to pure CSS at build time while still allowing to colocate styles with components, write dynamic style expressions, etc.

Ironically, I am also the author of (once popular) react-css-modules, which is the approach that GitHub team took.

11

u/yihuaxiang 1d ago

The 55% SSR number is the part I'd pay attention to. A lot of the CSS-in-JS cost wasn't the syntax, it was generating or injecting styles at request time on the server. CSS Modules (or plain CSS files) can be built once and served as static assets, so the HTML doesn't have to wait on a runtime to emit styles. That's a much bigger deal on a large app than whether you like writing className or not.

3

u/New-Peach4153 1d ago

I'd like to say GitHub is typically a buggy/bad UX whenever I bother using the website

1

u/dusanodalovic 19h ago

three years is what stands out to me. while both were live on the same pages, how did they keep the old runtime styles and the new css files from fighting over order and specificity? did they go page by page or component by component

1

u/TheJase 9h ago

CSS Cascade Layers would solve that immediately

1

u/Lurker-8580 13h ago

Reinventing the wheel over and over again

•

u/FigureNo77 2h ago

just use static css files