Replies: 3 comments 5 replies
-
Here's a project that uses cva for its primitives Maybe @Jonas-C can chime in as well to share their thought process. For shipping config recipes in a design system, I generally prefer pre-generating the styles so you don't have to worry about the JIT stuff. You can also configure the |
Beta Was this translation helpful? Give feedback.
-
Hey, @cgatian. We struggled with the same thing you're currently dealing with, and opted for cva due to the same reasoning you specified. At some point I also spoke a bit with Alex (@astahmer) about this on Discord, where he stated that having a more involved tracking solution would introduce too large of a perf overhead. We did a couple of things to make cva a little more "livable":
I'm trying to write some general documentation around our usage of panda as a whole. There might be some useful stuff about the plugin and the general inner workings of cva in there. NDLANO/frontend-packages#2561 |
Beta Was this translation helpful? Give feedback.
-
We're also using |
Beta Was this translation helpful? Give feedback.
-
I've been looking at using config recipes for our component library, but find that since they are JIT compiled it makes it harder for consumers to reuse these recipes within their app. If we want a consumer to reuse the config recipe we have two options:
staticCSS
.staticCSS
on the recipe they want to repurpose.In addition, if a consumer were to publish a
NewButton
based on theButton
(using config recipe). They would need to then notify all consumers of theNewButton
to also include thestaticCSS
option for the button recipe. I feel like this just doesn't scale well.Given these drawbacks, I'm considering using atomic recipes instead (
cva
) for the component library. This will allow consumers to reuse the recipe within their app without any additional configuration. The drawback to this approach is that the atomic CSS is always included regardless of whether the consumer uses the component. But has the benefit of using atomic CSS, in which the CSS size should eventually plateau.Some questions:
cva
s approach for their component library?In evaluating PandaCSS for our organization I'm left wishing there was some middle ground, where only components included in the application are generated with atomic CSS. I understand this is what config recipes try to solve, but find the extra configuration required a bit cumbersome. I would love to know how others are dealing with this.
Beta Was this translation helpful? Give feedback.
All reactions