Releases: joe-bell/cva
Releases · joe-bell/cva
v0.2.2
v0.2.1
v0.2.0
Fixes
- Improved/corrected support for
boolean
variants; both as a prop anddefaultVariant
Features
-
defaultVariants
styles can now be disabled/removed completely by setting the relevant variant asnull
const button = cva("button", { variants: { disabled: { false: "button--enabled", true: "button--enabled" }, }, defaultVariants: { disabled: false, }, }); const buttonWithDefault = button(); // "button button--enabled" const buttonWithoutDefault = button({ disabled: null }); // "button"
Pull Requests
- chore(deps): bump follow-redirects from 1.14.7 to 1.14.8 by @dependabot in #11
- Advise aliasing during install instead of TS Paths by @hasparus in #17
- docs: remove unnecessary comment in README by @williamhzo in #18
- fix: allow both boolean states for boolean variant by @brattonross in #22
- Add missing word to README by @hasparus in #26
- Fix Behaviour of Falsey Boolean Variants by @joe-bell in #24
New Contributors
- @hasparus made their first contribution in #17
- @williamhzo made their first contribution in #18
- @brattonross made their first contribution in #22
Full Changelog: v0.1.0...v0.2.0
v0.1.0
Adds support for boolean variants (huge thanks to @mariusflorescu) 🚀
const button = cva(["text-white", "bg-blue-700"], {
variants: {
disabled: {
true: "opacity-50",
false: "opacity-100",
},
},
});
button({ disabled: true });