Closed
Description
Sadly, the boolean support for variants doesn't work. It's supposed two work.
The problem is true
passed as string to the Twig. Is there a way to solve this issue
{% props theme = "primary", size = null, text = null, disabled = false %}
<button
class="{{ cva({
base: "btn",
variants: {
theme: {
primary: "btn-primary",
secondary: "btn-secondary",
ghost: "btn-ghost",
link: "btn-link",
},
size: {
xs: "btn-xs",
sm: "btn-sm",
md: "btn-md",
lg: "btn-lg",
},
disabled: {
true: "btn-disabled",
},
},
compoundVariants: [],
}).apply({ theme, size }, attributes.render("class")|default("")) }}"
{{ attributes.without("class") }}
>
{% if block("content") is defined %}
{{ block("content") }}
{% elseif text|length %}
{{ text }}
{% endif %}
</button>
Metadata
Metadata
Assignees
Labels
No labels