Pigment CSS

CSS in React Server Components

Josh Comeau

Vercel's stable release of React framework Next 13.4 has introduced the groundbreaking React Server Components (RSC). However, this has led to compatibility issues with popular CSS-in-JS libraries like styled-components and Emotion. The problem arises as RSC is a server-exclusive code, meaning it never interacts with the browser unlike the in-browser requirement of styled-components. However, recent advancements like Pigment CSS, a library developed by Material UI's team, may offer a solution by using CSS Modules and transforming styles at compile-time for full compatibility with RSC. Despite this, developers shouldn't feel rushed to migrate as styled-components can still be used efficiently in modern React applications.

read full post