A settings page shows the same button a hundred times. Its background color is fixed. How much work should the browser do to discover that color?
That hypothetical page is a useful starting point for a styling discussion. It gives you something to inspect before choosing a library to remove.
On September 25, 2026, GitHub published its account of moving away from CSS-in-JS toward CSS Modules. It described runtime styling costs as component counts grew. The work happened over several years; the publication date is not the migration’s start date. GitHub’s engineering account.
The question for another application is whether it pays a similar cost. Authoring styles in JavaScript does not establish when those styles are produced. Build-time extraction and runtime generation need to be investigated separately.

Follow one button to the screen
For the imagined settings page, first inspect the production HTML and stylesheet requests. Are the button’s initial rules already available, or must application code run to produce them? Does each rerender generate work for a style that has not changed?
Then record page load and one representative interaction. Look for time in scripting, style calculation, and layout. Identify which work actually delays the visible content or the response to input. A large JavaScript bundle is a lead to investigate, not a diagnosis by itself.
CSS has costs too. A render-blocking stylesheet can delay the initial render, and the browser still needs to calculate styles and layout. Moving work out of JavaScript does not remove the rendering pipeline. web.dev’s critical-path guide.
Suppose the hypothetical button has three fixed sizes. One candidate implementation is three classes selected by a prop. A genuinely continuous value, such as progress, might remain a CSS custom property. This is a proposed alternative to compare, not proof that the existing implementation is slow.
Make the comparison small enough to reverse
Keep one route, the same data, and the same rendered states. Change the styling of one frequently repeated component. Compare production builds on the same device, with consistent network and CPU settings, testing cold and warm caches separately. Repeat runs so one unusually fast load does not decide the outcome.
Use the result to answer specific questions:
- Did initial content appear earlier, and did the element measured as LCP remain comparable?
- Did the relevant interaction spend less time in scripting or rendering?
- Did focus, disabled states, themes, or responsive layouts change?
If runtime styling barely registers, stop there. Investigate the larger delay visible in the trace. If it does dominate, the small conversion gives you a measurable reason to continue and a bounded change to roll back. Neither outcome requires deciding that one styling approach is right for every website.
Comments (0)