You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: update installation guide to add tailwind css v4 instructions while keeping v3 details (#180)
This PR updates the installation guide for this plugin,
[@tailwindcss/forms](https://github.com/tailwindlabs/tailwindcss-forms),
to include setup instructions for Tailwind CSS v4 using `@plugin` in the
`style.css` file, while retaining the existing instructions for v3 users
who are yet to upgrade.
**Why this PR?**
Based on my experience, I've had to refer to the typography plugin docs
for setup instructions and adapt them for the forms plugin. This update
ensures the guide is clear and useful for both Tailwind CSS v3 and v4
users.
---------
Co-authored-by: Jordan Pittman <jordan@cryptica.me>
Copy file name to clipboardExpand all lines: README.md
+21-1Lines changed: 21 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,15 @@ Install the plugin from npm:
10
10
npm install -D @tailwindcss/forms
11
11
```
12
12
13
-
Then add the plugin to your `tailwind.config.js` file:
13
+
Then, when using Tailwind CSS v4, add the plugin to your main stylesheet:
14
+
15
+
```css
16
+
/* app.css */
17
+
@import"tailwindcss";
18
+
@plugin "@tailwindcss/forms";
19
+
```
20
+
21
+
If you are still using **Tailwind CSS v3**, add the plugin to your `tailwind.config.js` file:
14
22
15
23
```js
16
24
// tailwind.config.js
@@ -107,6 +115,18 @@ Although we recommend thinking of this plugin as a "form reset" rather than a co
107
115
108
116
If generating both the global (base) styles and classes doesn't work well with your project, you can use the `strategy` option to limit the plugin to just one of these approaches.
109
117
118
+
When using Tailwind CSS v4, configure the plugin in your main stylesheet:
119
+
120
+
```css
121
+
/* app.css */
122
+
@plugin "@tailwindcss/forms" {
123
+
strategy: "base"; /* only generate global styles; or */
124
+
strategy: "class"; /* only generate classes */
125
+
}
126
+
```
127
+
128
+
If you are still using **Tailwind CSS v3**, configure the plugin in your `tailwind.config.js` file:
0 commit comments