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
When extending tv objects in cascade, the compoundVariants gets lost.
tv
compoundVariants
To Reproduce
import { tv } from 'tailwind-variants' const themeButton = tv({ base: 'font-medium', variants: { color: { primary: 'text-blue-500' }, disabled: { true: 'opacity-50' } }, compoundVariants: [{ color: 'primary', disabled: true, class: 'bg-black' }], defaultVariants: { color: 'primary', disabled: true } }) const appButton = tv({ extend: themeButton }) const button = tv({ extend: appButton }) console.log('appButton', appButton()) // -> font-medium text-blue-500 opacity-50 bg-black console.log('button', button()) // -> font-medium text-blue-500 opacity-50
Expected behavior
The appButton and button function calls should have the same results.
appButton
button
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered:
@mskelton could you please take a look at this?
Sorry, something went wrong.
fix: support multi-level extend for compoundVariants
e69cb2f
Fixes #168
@jrgarciadev PR opened to fix this #170
fix: support multi-level extend for compoundVariants (#170)
8ec5f34
* fix: support multi-level extend for `compoundVariants` Fixes #168 * chore: add `test:watch` script for testing
Successfully merging a pull request may close this issue.
Describe the bug
When extending
tv
objects in cascade, thecompoundVariants
gets lost.To Reproduce
Expected behavior
The
appButton
andbutton
function calls should have the same results.Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: