We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug
Using tailwind-variants with slots, compoundVariants, defaultVariants and explicitly passing the variants as undefined breaks.
undefined
To Reproduce
import { tv } from "tailwind-variants"; const variants = tv({ slots: { root: "", }, variants: { variant: { solid: {}, }, orientation: { horizontal: { root: "", }, }, }, compoundVariants: [ { orientation: "horizontal", variant: "solid", className: { root: "border-b", }, }, ], defaultVariants: { orientation: "horizontal", variant: "solid", }, }); const { root } = variants(); console.log(root({})) // Output: "border-b" console.log(root({ orientation: undefined, variant: undefined })) // Output: ""
Expected behavior It should use the defaultVariants
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
I have the same? experience:
const tvSpeaker = tv({ slots: { slotRoot: "flex", slotBody: "flex flex-col", slotFontSize: "", }, variants: { layout: { vertical: { slotRoot: "flex-col", slotBody: "text-center", slotFontSize: "", }, horizontal: { slotRoot: "flex-row flex-nowrap", slotBody: "flex-row", slotFontSize: "", }, }, }, defaultVariants: { layout: "horizontal", }, });
export const Speaker: React.FC<SpeakerProps> = ({ layout, ...props }) => {}
When I log layout it's undefined.
Sorry, something went wrong.
No branches or pull requests
Describe the bug
Using tailwind-variants with slots, compoundVariants, defaultVariants and explicitly passing the variants as
undefined
breaks.To Reproduce
Expected behavior
It should use the defaultVariants
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: