Releases: nextui-org/tailwind-variants
Releases Β· nextui-org/tailwind-variants
v0.1.0
What's Changed
π Features
- On-Demand transform. by @tianenpang
- New config api
responsiveVariants
. by @tianenpang - New parameter added
compoundSlots
to apply classes to multiple slots at once, this reduces the amount of repeated code by @jrgarciadev -
tailwind-merge
package upgraded to1.10.0
by @jrgarciadev
π Fixes
- Fixed issue with failed transform when using
extend
. by @tianenpang - Fixed issue with children slots are now being returned for extended tv functions with slots #23 by @jrgarciadev
βοΈ Refactor
- Types declaration improved by @jrgarciadev
- Tests improved by @jrgarciadev
π΄ Breaking Changes
To be able to use Responsive Variants
you need to include responsiveVariants: true
or responsiveVariants:['xs', 'sm', ....allDesiredVariants']
in the configuration object. This ensures that tv
functions only generate responsive variants for the specified breakpoints, significantly reducing the amount of CSS generated in the final bundle.
Example:
const button = tv({
base: "font-semibold text-white py-1 px-3 rounded-full active:opacity-80",
variants: {
color: {
primary: "bg-blue-500 hover:bg-blue-700",
secondary: "bg-purple-500 hover:bg-purple-700",
success: "bg-green-500 hover:bg-green-700",
},
size: {
small: "py-1 px-2 text-xs",
medium: "py-1 px-2 text-sm",
large: "py-1.5 px-3 text-md",
},
},
},
+ {
+ responsiveVariants: ['sm', 'md']
+ }
);
// the function call remains unchanged.
button({
color: {
initial: "primary",
sm: "success",
md: "secondary",
},
size: {
initial: "small",
sm: "medium",
md: "large",
},
})}
Credits
Huge thanks to @tianenpang ππ»
Stay tuned to the documentation website for examples. π
Full Changelog: v0.0.31...v0.1.0
v0.0.31
v0.0.29
What's Changed
- fix: class and className of TVProps by @tianenpang in #2
- fix: pipeline by @tianenpang in #4
- feat: variant keys by @tianenpang in #3
- feat: responsive variant transformer by @tianenpang in #5
- feat: responsive slot and improvements by @tianenpang in #6
- feat: with-tv by @tianenpang in #7
- fix: nested class value type by @tianenpang in #9
- feat: add components composition by @jrgarciadev in #8
- feat: respect tailwind config by @tianenpang in #10
New Contributors
- @tianenpang made their first contribution in #2
- @jrgarciadev made their first contribution in #8
Full Changelog: https://github.com/nextui-org/tailwind-variants/commits/v0.0.29