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
Copy file name to clipboardExpand all lines: README.md
+50-1Lines changed: 50 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,7 @@ module.exports = {
31
31
}
32
32
```
33
33
34
-
## Usage
34
+
## Basic usage
35
35
36
36
[**View the live demo**](https://tailwindcss-forms.vercel.app/)
37
37
@@ -72,3 +72,52 @@ Every element has been normalized/reset to a simple visually consistent style th
72
72
```
73
73
74
74
More customization examples and best practices coming soon.
75
+
76
+
### Using classes instead of element selectors
77
+
78
+
Although we recommend thinking of this plugin as a "form reset" rather than a collection of form component styles, in some cases our default approach may be too heavy-handed, especially when integrating this plugin into existing projects.
79
+
80
+
For situations where the default strategy doesn't work well with your project, you can use the `class` strategy to make all form styling _opt-in_ instead of applied globally:
81
+
82
+
```js
83
+
// tailwind.config.js
84
+
plugins: [
85
+
require("@tailwindcss/forms")({
86
+
strategy:'class',
87
+
}),
88
+
],
89
+
```
90
+
91
+
When using the `class` strategy, form elements do not receive any reset styles by default, and reset styles are added per element using a new set of `form-*` classes generated by the plugin:
0 commit comments