mui / pigment-css

Pigment CSS is a zero-runtime CSS-in-JS library that extracts the colocated styles to their own CSS files at build time.
MIT License
396 stars 19 forks source link

[RFC] Rely on <style> element rather than CSS Modules? #81

Open oliviertassinari opened 1 month ago

oliviertassinari commented 1 month ago

Summary

Considering the support of stylesheet in React 19 https://react.dev/blog/2024/04/25/react-19#support-for-stylesheets. I wonder if we couldn't rely on this rather than on the emission of a CSS Modules file. The docs: https://react.dev/reference/react-dom/components/style. Maybe this would make the bundlers integration simpler, we would only need to transpile the source.

Examples

No response

Motivation

Simplify the bundler integration. It might mean that we only need to transpile code, like https://react.dev/learn/react-compiler is doing.

Two concerns though:

Search keywords: -