|
20 | 20 | ## Features
|
21 | 21 |
|
22 | 22 | - First-class variant API
|
23 |
| -- Responsive variants |
24 | 23 | - Slots support
|
25 | 24 | - Composition support
|
26 | 25 | - Fully typed
|
27 | 26 | - Framework agnostic
|
28 | 27 | - Automatic conflict resolution
|
| 28 | +- Tailwindcss V4 support |
29 | 29 |
|
30 | 30 | ## Documentation
|
31 | 31 |
|
32 | 32 | For full documentation, visit [tailwind-variants.org](https://tailwind-variants.org)
|
33 | 33 |
|
| 34 | +> ❕ Note: `Tailwindcss V4` no longer supports the `config.content.transform` so we remove the `responsive variants` feature |
| 35 | +> |
| 36 | +> If you want to use `responsive variants`, you need to add it manually to your classname. |
| 37 | +
|
34 | 38 | ## Quick Start
|
35 | 39 |
|
36 | 40 | 1. Installation:
|
@@ -75,46 +79,6 @@ const button = tv({
|
75 | 79 | return <button className={button({size: "sm", color: "secondary"})}>Click me</button>;
|
76 | 80 | ```
|
77 | 81 |
|
78 |
| -3. Responsive variants configuration (optional): If you want to use responsive variants |
79 |
| - you need to add the Tailwind Variants `wrapper` to your TailwindCSS config file `tailwind.config.js`. |
80 |
| - |
81 |
| -```js |
82 |
| -// tailwind.config.js |
83 |
| - |
84 |
| -const {withTV} = require("tailwind-variants/transformer"); |
85 |
| - |
86 |
| -/** @type {import('tailwindcss').Config} */ |
87 |
| -module.exports = withTV({ |
88 |
| - content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"], |
89 |
| - theme: { |
90 |
| - extend: {}, |
91 |
| - }, |
92 |
| - plugins: [], |
93 |
| -}); |
94 |
| -``` |
95 |
| - |
96 |
| -If you're using a custom path to import Tailwind variants, such as creating a custom tv instance with `createTV`, it's recommended to include this path in the transformer configuration: |
97 |
| - |
98 |
| -```js |
99 |
| -// tailwind.config.js |
100 |
| - |
101 |
| -const {withTV} = require("tailwind-variants/transformer"); |
102 |
| - |
103 |
| -/** @type {import('tailwindcss').Config} */ |
104 |
| -module.exports = withTV( |
105 |
| - { |
106 |
| - content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"], |
107 |
| - theme: { |
108 |
| - extend: {}, |
109 |
| - }, |
110 |
| - plugins: [], |
111 |
| - }, |
112 |
| - { |
113 |
| - aliases: ["@/lib/tv"], |
114 |
| - }, |
115 |
| -); |
116 |
| -``` |
117 |
| - |
118 | 82 | ## Acknowledgements
|
119 | 83 |
|
120 | 84 | - [**cva**](https://github.com/joe-bell/cva) ([Joe Bell](https://github.com/joe-bell))
|
|
0 commit comments