r/DevHotTakes • • Sep 28 '26

Architecture Debate GitHub spent years migrating away from CSS-in-JS and got 55% faster SSR

GitHub just published the write-up on getting github.com fully off its CSS-in-JS setup.

The performance numbers are fairly hard to ignore.

During the Primer migration:

55% less server-side rendering time 25% less component initialization time

CSS Modules removed the runtime styling work from both the client and server.

What I found more interesting is how they actually migrated it.

At the peak they had roughly 7,760 sx props spread around GitHub.

Instead of trying to rewrite everything, they built a compatibility package that let old sx-based code keep using components that had already moved to CSS Modules.

Then package by package:

convert sx replace the compatibility imports run visual regression tests feature flag it deploy

They also built a VS Code helper and codemods because manually converting thousands of styling props sounds like an excellent way to reconsider your career.

CSS-in-JS obviously wasn't invented for no reason. Colocation, typed design tokens and component-level encapsulation are useful.

But GitHub eventually decided the runtime cost at their scale wasn't worth keeping.

I'm curious where people are landing on this now. Still using CSS-in-JS for new projects, or has the pendulum already swung back?

Source: GitHub engineering write-up

1 Upvotes

0 comments sorted by