JSConf JP

What Panda CSS Makes Possible by Not Importing the Library Directly

Sponsor sessionTrack DJapanese

k8o

The mainstream of CSS-in-JS has shifted from runtime style injection, such as Emotion, to build-time CSS output, such as StyleX or vanilla-extract.

For the product I work on, we switched from Emotion to Panda CSS as we migrated to the Next.js App Router. Panda CSS is distinctive in that, rather than importing the library itself, you import code generated from configuration.

In this session, we’ll compare it with StyleX and vanilla-extract and explain what importing generated code provides. Using a plugin that relaxes type checking to prohibit values other than design tokens for only certain properties as an example, we’ll introduce what this architecture makes possible—along with its pain points.