Skip to content
Innovation & Growth

GitHub's Three-Year CSS Migration Cuts Server Render Time 55%

GitHub replaced CSS-in-JS with CSS Modules over three years, then used Copilot agents to finish the last mile.

W
WebPulse Newsroom
AI-assisted · 4 min read
Share on X LinkedIn
GitHub's Three-Year CSS Migration Cuts Server Render Time 55%

Photo: RDNE Stock project / Pexels

Key finding

Server-side render time: -55% (Source: GitHub Engineering blog (September 2026))

A styling system rebuilt without a visible outage

GitHub's Primer design system team has spent roughly three years replacing the CSS-in-JS approach behind every button, banner and breadcrumb on GitHub.com with CSS Modules, a format that ships plain CSS instead of generating styles at runtime in the browser. The team, in an engineering blog post published this month, said the trigger was simple: as the number of components on individual pages grew starting in 2023, the existing runtime styling approach slowed initial page loads, degraded server-side rendering, and made every style update more expensive to ship. For an organization the size of GitHub, that meant a customer-facing performance problem showing up gradually across millions of page loads rather than in a single outage.

-55%
Server-side render time
Source: GitHub Engineering blog (September 2026)
-25%
Component initialization time
Source: GitHub Engineering blog (September 2026)

The bigger cost wasn't the components — it was every team using them

Migrating Primer's own components was finished by December 2024 using feature flags and visual regression tests to catch breakage before it reached users. The harder problem was a customization prop called "sx," which had become the default way for GitHub engineers across the company to override component styling with inline objects. Removing the underlying CSS-in-JS library required tracking down every one of those usages first — a scope of work that extended far outside the design system team itself and into GitHub's main product codebase.

6,419 of ~7,760
sx props migrated by 8 engineers over 6 months
Source: GitHub Engineering blog (September 2026)

AI coding agents compressed the final stretch

That six-month push ran from April to October 2025 and delivered server-side rendering gains of 1% to 22% on affected pages, with a rotation of eight engineers migrating 6,419 of the roughly 7,760 sx props identified at the outset. GitHub's account does not detail what happened over the following months beyond noting that Copilot's coding capabilities were improving in parallel. By the time the team returned to the remaining work in April 2026, 895 sx props were still outstanding. A much smaller crew of two engineers, using Copilot coding agents, cleared that backlog in about three weeks. By June 2026, GitHub reported running entirely on CSS Modules, having fully removed the styled-components and styled-system libraries from its production codebase — closing a migration that began before generative coding tools were part of the workflow and ended with them doing a meaningful share of the mechanical labor.

895 to 0 in 3 weeks, 2 engineers
Remaining sx props cleared in April 2026
Source: GitHub Engineering blog (September 2026)

What it tells a budget-holder about re-platforming costs

This is one company's account of one migration, not a benchmark for how long or how much similar technical debt cleanup costs elsewhere — GitHub's engineering scale and in-house tooling (a custom VS Code plugin and codemods, on top of Copilot agents) are not universal. But the numbers GitHub disclosed give budget-holders a concrete reference point for two things that are often estimated loosely: labor curves and safety infrastructure. The bulk of the manual migration took eight engineers six months; the AI-assisted final phase took two engineers three weeks. Neither phase moved without feature flags, staged rollouts, and visual regression testing already in place — safeguards that are easy to leave out of a migration budget until something breaks.

Questions worth putting to an engineering team before funding a similar re-platform: Do we have server-rendering or page-load metrics granular enough to show whether our current front-end architecture is actually costing us load time, the way GitHub's data showed for CSS-in-JS? If we plan to use AI coding agents for a mechanical migration, do we already have the automated test coverage — visual regression suites, feature flags — needed to trust their output without adding review overhead? And is this being planned as a multi-year program with milestones, given GitHub's own effort ran from 2023 to June 2026, rather than priced as a single quarter's project?

Produced by the WebPulse Newsroom with AI assistance from the original reporting credited below, and checked against that source by our editorial review. How we use AI.
Original reporting: github.blog.

Share this insight