Counter-Intuitive Optimization: How GitHub Improved Site Performance by Shipping More CSS

GitHub improved performance by shipping more CSS through smarter delivery architecture, not by cutting file size.
GitHub's engineering team shared a counter-intuitive optimization: rather than reducing CSS size, they improved performance by organizing and delivering more CSS more effectively. The core challenge was upgrading a design system at scale without breaking existing pages. Key strategies included pre-computing static styles to eliminate JS runtime overhead, writing more explicit CSS rules to reduce cascade conflicts and repaints, and leveraging Critical CSS with browser caching to prevent layout shifts. The takeaway: real performance optimization is a systemic trade-off, not simply minimizing asset size.
A Counter-Intuitive Approach to Performance
GitHub's engineering team recently shared a seemingly paradoxical practice: improving site performance by "shipping more CSS." In traditional frontend performance thinking, reducing asset size and trimming CSS files are considered golden rules for faster load times. Yet GitHub's experience tells a different story — the key isn't the absolute amount of CSS, but rather how those styles are organized and delivered.

Published on The GitHub Blog, the article documents how a design system underwent a large-scale style refactor and upgrade without breaking existing pages. For any team maintaining a large codebase and design system, this kind of "swapping the engine mid-flight" engineering challenge is highly instructive.
The Core Challenge of Design System Upgrades
For a product at GitHub's scale, the design system underpins the visual consistency of hundreds of pages and components. Any change to foundational styles can cascade like dominoes into unexpected corners. This is exactly what makes design system iteration so tricky: the benefits of a change are clear, but the risks are scattered and hard to detect.
The phrase "without breaking the world" refers precisely to this challenge — how to push through major changes while ensuring existing pages don't suffer visual or functional regressions. This demands architectural trade-offs, not just simple additions or deletions of code.
A Design System is a comprehensive framework encompassing design principles, component libraries, style guidelines, and usage documentation — all aimed at maintaining visual and interaction consistency across teams. For a product of GitHub's scale, Primer (GitHub's official design system) must serve dozens of internal teams as well as open-source contributors. Design system upgrades are more complex than typical feature iterations because of their "infrastructure" nature: a change to a foundational token (such as a color variable or spacing unit) propagates through CSS custom properties or preprocessor variable inheritance chains, ultimately affecting every component that references it. The surface area for regression testing is virtually unlimited — which is why many teams turn to visual regression testing tools like Percy or Chromatic to automatically compare page screenshots before and after each change.
Why "More CSS" Can Actually Be Faster
Inferring from the article's premise, GitHub's strategy likely involves an architectural shift in how styles are delivered. In modern frontend engineering, "shipping more CSS" typically points to several possible optimization directions:
Moving from Runtime Computation to Static Styles
Many performance bottlenecks stem from the browser computing and recalculating styles at runtime. By converting some dynamic logic into pre-determined static CSS, the file size increases — but the JavaScript runtime overhead is eliminated, making rendering faster overall.
This idea has a classic parallel in the frontend world: the rise of atomic CSS frameworks like Tailwind CSS. Traditional CSS-in-JS solutions (such as styled-components or Emotion) dynamically generate style strings at runtime and inject them via
<style>tags — every component render can trigger a style recalculation, leading to significant JavaScript execution overhead in large applications. Atomic CSS or pre-generated static stylesheets, by contrast, move this work to the build phase. The browser receives already-determined rules, which are parsed and matched more efficiently. This is why, for the same visual output, a slightly larger static CSS file often outperforms a leaner dynamic styling solution in real-world rendering — the browser's CSS parsing engine is highly optimized native code, whereas runtime style computation in JavaScript carries additional engine overhead.
Reducing Style Overrides and Cascade Conflicts
When a design system defines components with more complete and explicit CSS rules, it reduces cascade conflicts and the need for later style overrides. Writing "a bit more" CSS upfront yields more predictable rendering behavior and fewer repaints.
Leveraging Caching and Parallel Loading
Splitting and pre-delivering critical CSS intelligently allows the browser to complete first-contentful paint earlier, avoiding layout shifts caused by missing styles. The increase in file size is offset by a better loading sequence.
Layout Shift is the core issue measured by Google's Core Web Vitals CLS (Cumulative Layout Shift) metric. When a page initially renders with default styles because the correct styles haven't loaded yet — and then jumps to the correct layout once they arrive — element positions shift in a way that directly harms user experience scores and SEO rankings. Critical CSS inlining was invented for exactly this problem: embed the minimal styles needed for above-the-fold rendering directly in the HTML
<head>, then load the rest asynchronously, so the browser's first paint already reflects the correct layout. The "pre-delivery" strategy GitHub refers to also exploits the long-term nature of HTTP caching — once a CSS file with a stable version and fixed content hash is cached by the browser, subsequent page visits incur virtually zero transfer cost. At that point, the trade-off of a slightly larger file size is completely amortized.
Lessons for Engineering Teams
GitHub's post is a reminder that performance optimization can't stop at the intuitive level of "smaller is always better." Real optimization is a systemic trade-off problem that requires holistic judgment based on the specific rendering pipeline, caching strategy, and user experience metrics.
For teams maintaining design systems, a few transferable principles stand out:
- Use real performance metrics as your benchmark, rather than simply chasing minimal asset size;
- Prioritize rollback capability and progressive rollouts, and avoid big-bang releases;
- Think about delivery at the architectural level, not just addition and subtraction at the code level.
Given the limited details disclosed in the original post, this article is primarily an engineering-perspective interpretation of GitHub's approach. Readers who want the full technical details and supporting data are encouraged to read the original piece on the GitHub Blog.
Related articles

Chain of Thought Isn't Just for AI: How Humans Can Use CoT to Improve Thinking Quality
Chain of Thought isn't just a prompt trick for large models. Starting from a Hacker News discussion, this article analyzes why CoT works for human thinking too, breaks down actionable ways to transfer it, and highlights the key differences between human CoT and machine CoT.
Cloudflare Teams Up with OpenAI: Closi…
Cloudflare Teams Up with OpenAI: Closing the Loop from Vulnerability Discovery to Defense with AI
Cloudflare uses OpenAI Daybreak to investigate security vulnerabilities and generate reviewable remediation plans, while developers use Codex to boost coding efficiency and quality.

Orca Multi-Agent Orchestration in Practice: A Guide to Parallel Collaboration with Claude and Codex
Orca is Stable AI's free open-source agent workbench supporting 34 agents like Claude Code and Codex in parallel. Learn its Git worktree isolation, multi-model orchestration, and mobile management.