Panda CSS v2: feature requests from a large-scale adopter #3522
Replies: 6 comments 9 replies
-
|
Really good points and ideas @kris-ellery. Will share with the team and come back with some questions. |
Beta Was this translation helpful? Give feedback.
-
|
Just wanted to chime in with another idea for v2: We'd love if some of the project dependencies could be made optional. Ideally you'd be able to pick what framework plugin to install and a choice between installing postcss/lightningcss. Having the mcp package be optional would also be nice. Furthermore, we've moved on from esbuild entirely. The only thing that's still pulling it in is panda. I'm not quite sure if there's a solid replacement for its usage in bundle-n-require, but maybe it's possibly to lean more closely on native node resolution when running Appreciate the continued work on all of your projects! |
Beta Was this translation helpful? Give feedback.
-
|
If there was a native implementation, it would be really nice to be able to connect that up to some native oxlint plugins as well so that whole DX can be super fast. Thanks Kris for this very detailed post, I second most of them, particularly 1, 3, 7, 15, & 16 |
Beta Was this translation helpful? Give feedback.
-
|
fully support the idea of porting to native. We are on a large codebase and even with all the optimization, build, rebuild is still very slow. Most of the time is spent on AST. |
Beta Was this translation helpful? Give feedback.
-
|
Another improvement I'd really appreciate: A way to generate less complex |
Beta Was this translation helpful? Give feedback.
-
|
Hey @Jonas-C @kris-ellery @leegunwoo98 @zachbwh @jimmymorris, Sorry for the many pings! Just wanted to let you know that v2 is now in beta, and we'd love for you to give it a try and see how it feels. If you run into any issues at all, feel free to comment here: #3599 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey team 👋
First off, thank you for everything you've put into Panda. We use it across hundreds of repos (apps and packages) and have built our entire design system on top of it. We're deeply invested and want to see v2 succeed. Below is a list of features and improvements we'd love to see in Panda CSS v2. Happy to help shape APIs, write tests, or provide more detail on any of these. Just let me know.
🚀 Performance
1. Faster compilation engine (Rust / oxc / esbuild)
Large applications with thousands of paths and many packages can hit 30s+ build and rebuild times in watch mode. There may well be optimization opportunities in the current implementation, but a faster underlying engine would meaningfully change the experience at scale. As a proof point, I prototyped a Rust port that built a medium-sized app in under 100ms, so the approach is viable.
🎨 Tokens & CSS Output
2. Built-in optimizations (or official plugins) for CSS variable cleanup
Two specific wins:
staticCss: { themes: ['one', 'two'] }.For projects with a lot of tokens, this can cut output size dramatically. I've seen ~50% reductions in some cases, but the exact impact scales entirely with the number of tokens defined. There's an unofficial
pandaboxplugin from one of the maintainers that does some of this, but it hasn't been updated and isn't first-party. Folding this into core (or maintaining it officially) would be a big win.3. Public vs. private token visibility
Design systems typically have three layers of tokens: raw, semantic, and component. Today we can define
tokensandsemanticTokens, but we can't control which ones are exposed to consumers. Ideally, raw and component tokens would remain fully usable inside the design system package itself (for building components, deriving semantic layers, etc.), but get stripped from generated TS types and IntelliSense when the preset is consumed downstream. Only semantic tokens should surface to consumers.4. Emit a JSON token map of what's actually in the compiled CSS
A build-time JSON artifact listing the tokens that made it into the final stylesheet would let consumers resolve values directly instead of maintaining a parallel token pipeline just to look up a value.
5. Atomic class deduplication for equivalent token references
color: 'red'andcolor: '{colors.red}'currently resolve to different atomic classes even though they reference the same value. This feels like a bug, flagging it here in case it can be folded into v2.🌗 Theming
6. Built-in
light-dark()emission for token CSS variablesAn option or official plugin to emit CSS variables using the native
light-dark()function, e.g.:This pattern significantly reduces duplicated light/dark theme CSS, but today it has to be hand-rolled.
📦 Multi-app, Federation & Distribution
7. Virtual / shared
styled-systempackageThe current docs lean on per-package
styled-systemgeneration inside a monorepo, which works fine until you want to ship a design system to NPM and have many external apps consume it. Today the workaround is shippingdistfiles with@/styled-systemand asking every consumer to alias it in their bundler config, which is fragile, easy to misconfigure, and hard to explain to teams.A first-class story for a virtual or shared
styled-system(one that the design system package, the consuming app, and any other Panda-built packages can all reference seamlessly) would unlock a lot for us.8. Bundler plugins for true CSS tree-shaking from design systems
If a design system ships
buildinfofor 100 components and an app imports only 10, the app still gets CSS for all 100. Two possible directions:buildinfoworks so unused component CSS doesn't ship.9. Federated module setup guidance and patterns
We'd love official guidance (and ideally features) for using Panda in federated module setups, where many isolated apps on the same page each use the design system or their own Panda-built components. Today we use hash prefixes plus shipping isolated styled-system methods and DS components with each federated module to avoid collisions. Workable, but heavy and hard to maintain.
10. Design-system-aware namespacing in hashing
Related to the federated case: if 10 MFEs (Micro Front-ends) use design system
v10.10and 2 usev10.14, we'd ideally see 2 CSS bundles (one per DS version), not 12. Factoring DS identity/version into the hash would let identical DS versions across MFEs naturally dedupe.11. Buildinfo collision guidance across Panda versions
Related but distinct: when a host app and a recipe library are built against different Panda versions,
buildinfocollisions can break things or produce conflicting output. Some official guidance, or features that prevent collisions outright, would help teams that can't always upgrade in lockstep.🧩 Recipes & Variants
12. Responsive props + variant tree-shaking in regular recipes
This is technically possible with config recipes today, but config recipes require maintaining an explicit list of tracked JSX components. So if
Buttonhas responsive props and someone extends it toMyRedButton, they have to remember to addMyRedButtonto the advanced JSX tracking list. That doesn't scale.Ideally, responsive variants could be defined in regular recipes and tree-shaken (including compound variants) based on actual usage. The other reason we avoid config recipes: they generate named (non-atomic) class names and duplicate CSS output, while regular recipes stay atomic. So today we're stuck choosing between atomic output and tree-shaken responsive variants.
13. Ergonomic child targeting
Targeting child components today means falling back to raw selectors like
> span,> div, or[data-ds-component="MyComponent"]. styled-components handled this nicely (though I'm not personally a fan of styled factories as the solution). I don't have a strong opinion on the API and am happy to leave the design to the team, but a more first-class way to target children would be very welcome.🛠️ Developer Experience & Tooling
14. Better
panda debug/ diagnostics for missing classesWhen a class is generated in source but doesn't appear in the final stylesheet (because of include globs, optimizations, patterns, etc.), Panda should explain why it was dropped (file, location, reason) instead of forcing devs to reverse-engineer it from config and logs.
15. A configurable linter (errors-only is fine)
Even a minimal linter that doesn't touch stylistic concerns would be valuable. As a starting point: a non-zero exit when the resulting CSS is invalid for any reason, with a file, line number, and a short explanation. Anything beyond that is bonus.
16. Official AI skills / guidelines
With AI-assisted coding becoming the default workflow, an official set of Panda CSS skills, best practices, and dos/don'ts (something LLMs and IDE assistants can ground on) would help teams keep usage consistent. Think recipe vs. atomic guidance, responsive patterns, token usage, things to avoid, all in a format suitable for AI tooling consumption.
Thanks again for all the work you've poured into this project. We're rooting for v2 and I'm happy to dig into any of these in more depth (APIs, tests, repros, whatever's most useful).
One last note: it's entirely possible some of these already have solutions or existing documentation that I've missed. Apologies in advance if that's the case, and pointers are very welcome.
Beta Was this translation helpful? Give feedback.
All reactions