swc-project / swc

Rust-based platform for the Web
https://swc.rs
Apache License 2.0
31.09k stars 1.22k forks source link

Document compiling nested CSS classes in styled-jsx #8564

Open vpontis opened 8 months ago

vpontis commented 8 months ago

Describe the feature

I opened an issue to compile nested CSS classes. That issue was closed (thank you!) but I'm not sure how to use SWC to compile nested CSS.

There was a comment in the PR that closed it:

styled-jsx crate now have a hook to transform CSS code using a Rust-side API

How can I use that in .swcrc to transform nested CSS? Or will I need to wait for the Next.js team to update the compiler in order to provide a hook in JS?

I am going to start poking around a bit more with actually running the Rust code. Thank you!

kdy1 commented 8 months ago

Or will I need to wait for the Next.js team to update the compiler in order to provide a hook in JS?

We are already working on it. https://github.com/vercel/next.js/pull/61086