Urgent.News

What's breaking now, across thousands of outlets.

Tech

Runtime CSS-in-JS deserves a rehearing

Runtime CSS-in-JS has largely been written off as too expensive for the browser. The reasons are familiar: some libraries rebuilt styles on every React render, interleaved stylesheet writes with rendering, accumulated generated CSS, and added React overhead to every styled element. Server rendering was awkward, React Server Components seemed incompatible, and build-time CSS appeared to eliminate…

The article titled "Runtime CSS-in-JS deserves a rehearing" discusses the ongoing debate surrounding the performance implications of runtime CSS-in-JS libraries. It references several studies and reports from 2019 to 2022 that highlight the hidden costs of various CSS-in-JS libraries and the potential benefits of generating styles early in the process.

The author argues that while browser generation is not always the most efficient option, it should remain available for cases where composition decisions remain open. The article uses the Tasty project as a case study, demonstrating how a runtime-capable system can provide benefits when it controls the timing and location of style generation.

Ultimately, the author suggests that the decision to use runtime CSS-in-JS should be based on a careful evaluation of the specific needs and constraints of each project.

Brief written by urgent.news from Dev.to's own syndicated text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

GTA 6: The Big Interview

The in-depth interview with Rockstar North's Rob Nelson in full, as he played through 30 minutes of the game ahead of the Netflix reveal.

Row vs. Column: Measuring Locality with csperf

Why this lesson exists Locality is often taught as a theoretical concept: row‑major arrays are faster than column‑major ones because the CPU cache lines are contiguous.

  • Benchmarks compiled with same optimization flags, JSON artifacts contain detailed metrics.
  • Diffing JSON files generates CSV highlighting layout performance differences on specific machines.

More from Wednesday 7 October →