Improving site performance by shipping more CSS
19 hours ago
- The Primer Design System migrated from CSS-in-JS to CSS Modules to address performance issues like increased component count and runtime costs.
- An incremental migration strategy with feature flags and wrapper components allowed safe updates without breaking existing GitHub functionality.
- The removal of the 'sx' prop, which caused performance degradation, was automated using VS Code plugins, codemods, and Copilot coding agents, reducing props from ~7,760 to zero over time.
- Theming dependencies on styled-components were decoupled, and by June 2026, GitHub fully adopted CSS Modules, achieving performance gains of 1-22% on server-side rendering time.