Replies: 2 comments
-
Beta Was this translation helpful? Give feedback.
0 replies
-
Not perfect, but I built a plugin for this use case: https://github.com/jonambas/panda-plugin-crv. Edit: with support for responsive compound variants. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've been trying to figure this out for a while now but couldn't come up with a solution.
Let's say I have a
Button
component that has 2 size variants,small
andlarge
. Now, I want to render the small variant on mobile and the larger one on desktop. I can't use breakpoints here (which is what everyone should use for responsive things imo, but I'm limited here) because I have other places within the same page that has a large button (i.e, a single page can have both variants at different locations).Config recipes are built for this, it works and that's cool but I feel the DX around it is not ideal. Don't get me wrong, Panda is cool and it does allow me to do a heck lot of other complicated stuff but defining every component that's going to be using responsive variants in config is just ... a bit annoying 🙃.
So, is there a way we can have responsive variants like how config recipe allows but without having to define it in config?
The way I'm doing it for now is render both variants and hide the other one on large breakpoint, like:
(Which is not good, I know, but for now it Just Works™ 😅)
Beta Was this translation helpful? Give feedback.
All reactions