swc-project / swc-project/swc

Document compiling nested CSS classes in styled-jsx

Open
#8,564 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Rust
Stars
34.2k
Forks
1.6k
Avg merge
23h 11m
Merged PRs (30d)
125

Description

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!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the styled-jsx crate hook described in the linked SWC pull request and the .swcrc configuration mentioned in the issue. Trace how the Rust-side CSS transform is exposed, then document whether nested CSS can be configured there or whether a compiler update is required.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, next.js, rust
Domain
compilers, documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.