Suggestion: remove unnecessary classes for slot variants #2476
peterbartels
started this conversation in
General
Replies: 1 comment
-
This sounds an interesting idea. Looking deeply the following scenarios:
I wonder how those would be managed. I’d love an approach that doesn’t lead to more runtime code. |
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
-
When I use a slot recipe with a certain variant this variant is also added to slots where it's not defined. This leads to exra unnecessary classes in the class attribute
let's say I have two slots
root
andbody
where onlyroot
has an adjusted variant styleSo a
card__body--variant_blue
is added even when there is no variant defined for this slot.For example:
variants:{ variant: { blue: { root: { background: 'lightblue' } } } }
I get this non existing class for body slot:
<div class="card__body card__body--variant_blue">
Example in playground: https://play.panda-css.com/qWJ0iRgeXK
Beta Was this translation helpful? Give feedback.
All reactions