← Back to Tech Radar
Hacker News tech

Improving site performance by shipping more CSS

Trending on Hacker News: Improving site performance by shipping more CSS (75 points / 61 comments, via github.blog)

In one line

How we fully migrated github.com away from CSS-in-JS.

Opening excerpt

8 minutes Share: The Primer Design System powers many of the experiences you see on GitHub today. From buttons to banners to breadcrumbs, these foundational components are required to be accessible, flexible, and performant across a wide variety of scenarios.

Back in 2023, the number of components on certain pages began to explode. This led to several performance-related challenges with our existing CSS-in-JS solution:

It became clear that the Primer team needed to address the issue at the source. We needed to find an alternative that would completely avoid the client and server costs that we were seeing with our current solution. Most importantly, any alternative we pick would need to work in a way that would avoid any breakage to GitHub during the migration.

The Primer team found a solution that met all of our criteria: CSS Modules . This format would allow us to do one of our favorite things: write and use native CSS features, while still allowing some amount of the colocation and encapsulation that we had come to expect from CSS-in-JS.

(Excerpted from the original; full article via the source link below.)

This story hit the Hacker News front page today (75 points / 61 comments, via github.blog). Our Tech Radar aggregates daily signals on AI engineering, backend architecture and DevOps — browse the related services and further reading below, or get in touch with our team.

Source: Hacker News

Related Services