GitHub Moves github.com to CSS Modules
The three-year migration away from CSS-in-JS cut server-side rendering time by 55% and sped up component initialization across its Primer design system.
Updated on Nov. 25, 2026 in Software

GitHub has completed a three-year migration of github.com from CSS-in-JS to CSS Modules. The company reported a 55% reduction in server-side rendering time after the change.
Why it matters
Component counts on certain github.com pages grew substantially in 2023, exposing scaling problems with the existing styled-components setup. CSS Modules removes client and server runtime work by rolling styles into static stylesheets.
GitHub reported a 55% reduction in server-side rendering time and 25% faster component initialization across its Primer design system. The migration involved roughly 7,760 sx prop usages, and the company has not reported end-user performance gains beyond these server-side and initialization figures.
The players
GitHub
GitHub is a Microsoft-owned software development platform that hosts code repositories and developer tools used by millions of developers worldwide.
styled-components
styled-components is a widely used open-source CSS-in-JS library for React that lets developers write component-scoped styles in JavaScript.
The details
Eight engineers migrated 6,419 props over six months, and two engineers cleared the final 895 props in three weeks. GitHub decoupled theming for its seven themes and high-contrast variants before removing styled-components, which has entered maintenance mode. Each Primer component received a CSS Modules variant gated behind a feature flag and verified for visual parity before rollout.
Timeline
2023: Component counts on certain github.com pages began to grow substantially, exposing scaling problems.
December 2024: Primer was fully migrated to CSS Modules.
Over six months: Eight engineers migrated 6,419 props.
Over three weeks: Two engineers cleared the final 895 props.
Three years: Total duration of the github.com migration effort.
The Tech Race
GitHub's move follows a broader industry shift away from runtime CSS-in-JS libraries toward build-time CSS Modules, a pattern that Linear's migration from styled-components to StyleX, reported in a separate account, also reflects. The change positions GitHub's Primer system to avoid the client and server runtime costs that CSS-in-JS imposes at scale.
Developers building on Primer or maintaining styled-components code will need to weigh the maintenance-mode status of styled-components when planning future styling work. The change shows how a shift in styling architecture can affect page speed for anyone using github.com.
The takeaway
Teams running large component libraries should measure runtime styling costs early, since component counts can grow faster than expected and expose scaling limits in CSS-in-JS setups.
Further reading
Explore more Software news to see how developer tooling choices like styling systems shape modern web platforms.
Source note: This article includes information reported by InfoQ.



