Allow selecting another slot in slotRecipe #1371
-
const buttonRecipe = defineSlotRecipe({
className: 'button',
slots: ['base', 'spinner'],
variants: {
sm: {
base: {
spinner: {
w: '20',
h: '20',
}
}
}
}
}); And it will generates class like this: .button-base .spinner {
....
} By doing this I would be able to override the default size of spinner component. |
Beta Was this translation helpful? Give feedback.
Answered by
segunadebayo
Sep 14, 2023
Replies: 2 comments
-
this should work const buttonRecipe = defineSlotRecipe({
className: 'button',
slots: ['base', 'spinner'],
variants: {
sm: {
base: {
- spinner: {
+ "& .spinner": {
w: '20',
h: '20',
}
}
}
}
}); you could even do something like // ...
[`& .${spinnerRecipe.className}`]: {
// .. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I think this is a good use case for compound variants. const buttonRecipe = defineSlotRecipe({
className: 'button',
slots: ['base', 'spinner'],
variants: {
sm: { }
},
compoundVariants: [
{
variant: ["sm"],
css: {
spinner: {
// ... overrides
}
}
}
]
}); |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
anubra266
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think this is a good use case for compound variants.