create-huenei-template 0.2.3 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/templates/frontend/angular-base/.cursor/skills/angular-component/SKILL.md +288 -0
- package/dist/templates/frontend/angular-base/.cursor/skills/angular-component/references/component-patterns.md +358 -0
- package/dist/templates/frontend/angular-base/.cursor/skills/angular-di/SKILL.md +387 -0
- package/dist/templates/frontend/angular-base/.cursor/skills/angular-di/references/di-patterns.md +519 -0
- package/dist/templates/frontend/angular-base/.cursor/skills/angular-directives/SKILL.md +437 -0
- package/dist/templates/frontend/angular-base/.cursor/skills/angular-directives/references/directive-patterns.md +570 -0
- package/dist/templates/frontend/angular-base/.cursor/skills/angular-forms/SKILL.md +434 -0
- package/dist/templates/frontend/angular-base/.cursor/skills/angular-forms/references/form-patterns.md +398 -0
- package/dist/templates/frontend/angular-base/.cursor/skills/angular-http/SKILL.md +366 -0
- package/dist/templates/frontend/angular-base/.cursor/skills/angular-http/references/http-patterns.md +448 -0
- package/dist/templates/frontend/angular-base/.cursor/skills/angular-routing/SKILL.md +395 -0
- package/dist/templates/frontend/angular-base/.cursor/skills/angular-routing/references/routing-patterns.md +472 -0
- package/dist/templates/frontend/angular-base/.cursor/skills/angular-signals/SKILL.md +302 -0
- package/dist/templates/frontend/angular-base/.cursor/skills/angular-signals/references/signal-patterns.md +404 -0
- package/dist/templates/frontend/angular-base/.cursor/skills/angular-ssr/SKILL.md +435 -0
- package/dist/templates/frontend/angular-base/.cursor/skills/angular-ssr/references/ssr-patterns.md +497 -0
- package/dist/templates/frontend/angular-base/.cursor/skills/angular-testing/SKILL.md +660 -0
- package/dist/templates/frontend/angular-base/.cursor/skills/angular-testing/references/testing-patterns.md +707 -0
- package/dist/templates/frontend/angular-base/.cursor/skills/angular-tooling/SKILL.md +352 -0
- package/dist/templates/frontend/angular-base/.cursor/skills/angular-tooling/references/tooling-patterns.md +448 -0
- package/dist/templates/frontend/angular-base/.cursor/skills/tailwindcss-accessibility/SKILL.md +780 -0
- package/dist/templates/frontend/angular-base/.cursor/skills/tailwindcss-advanced-components/SKILL.md +718 -0
- package/dist/templates/frontend/angular-base/.cursor/skills/tailwindcss-advanced-design-systems/SKILL.md +612 -0
- package/dist/templates/frontend/angular-base/.cursor/skills/tailwindcss-advanced-layouts/SKILL.md +594 -0
- package/dist/templates/frontend/angular-base/.cursor/skills/tailwindcss-animations/SKILL.md +432 -0
- package/dist/templates/frontend/angular-base/.cursor/skills/tailwindcss-animations/references/animation-patterns.md +427 -0
- package/dist/templates/frontend/angular-base/.cursor/skills/tailwindcss-debugging/SKILL.md +354 -0
- package/dist/templates/frontend/angular-base/.cursor/skills/tailwindcss-debugging/references/troubleshooting-guide.md +306 -0
- package/dist/templates/frontend/angular-base/.cursor/skills/tailwindcss-framework-integration/SKILL.md +578 -0
- package/dist/templates/frontend/angular-base/.cursor/skills/tailwindcss-framework-integration/references/react-patterns.md +353 -0
- package/dist/templates/frontend/angular-base/.cursor/skills/tailwindcss-fundamentals-v4/SKILL.md +608 -0
- package/dist/templates/frontend/angular-base/.cursor/skills/tailwindcss-fundamentals-v4/references/advanced-theme-patterns.md +215 -0
- package/dist/templates/frontend/angular-base/.cursor/skills/tailwindcss-fundamentals-v4/references/custom-utilities-guide.md +281 -0
- package/dist/templates/frontend/angular-base/.cursor/skills/tailwindcss-mobile-first/SKILL.md +768 -0
- package/dist/templates/frontend/angular-base/.cursor/skills/tailwindcss-performance/SKILL.md +374 -0
- package/dist/templates/frontend/angular-base/.cursor/skills/tailwindcss-performance/references/bundle-optimization.md +244 -0
- package/dist/templates/frontend/angular-base/.cursor/skills/tailwindcss-plugins/SKILL.md +505 -0
- package/dist/templates/frontend/angular-base/.cursor/skills/tailwindcss-responsive-darkmode/SKILL.md +601 -0
- package/dist/templates/frontend/angular-base/.cursor/skills/tailwindcss-responsive-darkmode/references/advanced-responsive-patterns.md +485 -0
- package/dist/templates/frontend/angular-base/.cursor/skills/web-design-guidelines/SKILL.md +39 -0
- package/dist/templates/frontend/angular-base/package.json +0 -1
- package/dist/templates/frontend/angular-base/pnpm-lock.yaml +8183 -0
- package/package.json +1 -1
- package/templates/frontend/angular-base/.cursor/skills/angular-component/SKILL.md +288 -0
- package/templates/frontend/angular-base/.cursor/skills/angular-component/references/component-patterns.md +358 -0
- package/templates/frontend/angular-base/.cursor/skills/angular-di/SKILL.md +387 -0
- package/templates/frontend/angular-base/.cursor/skills/angular-di/references/di-patterns.md +519 -0
- package/templates/frontend/angular-base/.cursor/skills/angular-directives/SKILL.md +437 -0
- package/templates/frontend/angular-base/.cursor/skills/angular-directives/references/directive-patterns.md +570 -0
- package/templates/frontend/angular-base/.cursor/skills/angular-forms/SKILL.md +434 -0
- package/templates/frontend/angular-base/.cursor/skills/angular-forms/references/form-patterns.md +398 -0
- package/templates/frontend/angular-base/.cursor/skills/angular-http/SKILL.md +366 -0
- package/templates/frontend/angular-base/.cursor/skills/angular-http/references/http-patterns.md +448 -0
- package/templates/frontend/angular-base/.cursor/skills/angular-routing/SKILL.md +395 -0
- package/templates/frontend/angular-base/.cursor/skills/angular-routing/references/routing-patterns.md +472 -0
- package/templates/frontend/angular-base/.cursor/skills/angular-signals/SKILL.md +302 -0
- package/templates/frontend/angular-base/.cursor/skills/angular-signals/references/signal-patterns.md +404 -0
- package/templates/frontend/angular-base/.cursor/skills/angular-ssr/SKILL.md +435 -0
- package/templates/frontend/angular-base/.cursor/skills/angular-ssr/references/ssr-patterns.md +497 -0
- package/templates/frontend/angular-base/.cursor/skills/angular-testing/SKILL.md +660 -0
- package/templates/frontend/angular-base/.cursor/skills/angular-testing/references/testing-patterns.md +707 -0
- package/templates/frontend/angular-base/.cursor/skills/angular-tooling/SKILL.md +352 -0
- package/templates/frontend/angular-base/.cursor/skills/angular-tooling/references/tooling-patterns.md +448 -0
- package/templates/frontend/angular-base/.cursor/skills/tailwindcss-accessibility/SKILL.md +780 -0
- package/templates/frontend/angular-base/.cursor/skills/tailwindcss-advanced-components/SKILL.md +718 -0
- package/templates/frontend/angular-base/.cursor/skills/tailwindcss-advanced-design-systems/SKILL.md +612 -0
- package/templates/frontend/angular-base/.cursor/skills/tailwindcss-advanced-layouts/SKILL.md +594 -0
- package/templates/frontend/angular-base/.cursor/skills/tailwindcss-animations/SKILL.md +432 -0
- package/templates/frontend/angular-base/.cursor/skills/tailwindcss-animations/references/animation-patterns.md +427 -0
- package/templates/frontend/angular-base/.cursor/skills/tailwindcss-debugging/SKILL.md +354 -0
- package/templates/frontend/angular-base/.cursor/skills/tailwindcss-debugging/references/troubleshooting-guide.md +306 -0
- package/templates/frontend/angular-base/.cursor/skills/tailwindcss-framework-integration/SKILL.md +578 -0
- package/templates/frontend/angular-base/.cursor/skills/tailwindcss-framework-integration/references/react-patterns.md +353 -0
- package/templates/frontend/angular-base/.cursor/skills/tailwindcss-fundamentals-v4/SKILL.md +608 -0
- package/templates/frontend/angular-base/.cursor/skills/tailwindcss-fundamentals-v4/references/advanced-theme-patterns.md +215 -0
- package/templates/frontend/angular-base/.cursor/skills/tailwindcss-fundamentals-v4/references/custom-utilities-guide.md +281 -0
- package/templates/frontend/angular-base/.cursor/skills/tailwindcss-mobile-first/SKILL.md +768 -0
- package/templates/frontend/angular-base/.cursor/skills/tailwindcss-performance/SKILL.md +374 -0
- package/templates/frontend/angular-base/.cursor/skills/tailwindcss-performance/references/bundle-optimization.md +244 -0
- package/templates/frontend/angular-base/.cursor/skills/tailwindcss-plugins/SKILL.md +505 -0
- package/templates/frontend/angular-base/.cursor/skills/tailwindcss-responsive-darkmode/SKILL.md +601 -0
- package/templates/frontend/angular-base/.cursor/skills/tailwindcss-responsive-darkmode/references/advanced-responsive-patterns.md +485 -0
- package/templates/frontend/angular-base/.cursor/skills/web-design-guidelines/SKILL.md +39 -0
- package/templates/frontend/angular-base/package.json +0 -1
- package/templates/frontend/angular-base/pnpm-lock.yaml +8183 -0
- package/templates/frontend/angular-base/package-lock.json +0 -13321
|
@@ -0,0 +1,505 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tailwindcss-plugins
|
|
3
|
+
description: Tailwind CSS plugins including official plugins and custom plugin development
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Tailwind CSS Plugins
|
|
7
|
+
|
|
8
|
+
## Official Plugins
|
|
9
|
+
|
|
10
|
+
### @tailwindcss/typography
|
|
11
|
+
|
|
12
|
+
Beautiful typographic defaults for content you don't control (Markdown, CMS content).
|
|
13
|
+
|
|
14
|
+
#### Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install -D @tailwindcss/typography
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
```css
|
|
21
|
+
@import "tailwindcss";
|
|
22
|
+
@plugin "@tailwindcss/typography";
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
#### Basic Usage
|
|
26
|
+
|
|
27
|
+
```html
|
|
28
|
+
<article class="prose">
|
|
29
|
+
<h1>Article Title</h1>
|
|
30
|
+
<p>This content gets beautiful default styles...</p>
|
|
31
|
+
</article>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
#### Size Modifiers
|
|
35
|
+
|
|
36
|
+
| Class | Description |
|
|
37
|
+
|-------|-------------|
|
|
38
|
+
| `prose-sm` | Smaller text (14px base) |
|
|
39
|
+
| `prose` | Default (16px base) |
|
|
40
|
+
| `prose-lg` | Larger text (18px base) |
|
|
41
|
+
| `prose-xl` | Extra large (20px base) |
|
|
42
|
+
| `prose-2xl` | Huge (24px base) |
|
|
43
|
+
|
|
44
|
+
```html
|
|
45
|
+
<article class="prose md:prose-lg lg:prose-xl">
|
|
46
|
+
<!-- Responsive sizing -->
|
|
47
|
+
</article>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
#### Color Themes
|
|
51
|
+
|
|
52
|
+
```html
|
|
53
|
+
<article class="prose prose-slate">Gray theme</article>
|
|
54
|
+
<article class="prose prose-zinc">Zinc theme</article>
|
|
55
|
+
<article class="prose prose-neutral">Neutral theme</article>
|
|
56
|
+
<article class="prose prose-stone">Stone theme</article>
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
#### Dark Mode
|
|
60
|
+
|
|
61
|
+
```html
|
|
62
|
+
<article class="prose dark:prose-invert">
|
|
63
|
+
<!-- Automatically inverts for dark mode -->
|
|
64
|
+
</article>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
#### Element Modifiers
|
|
68
|
+
|
|
69
|
+
Override specific elements:
|
|
70
|
+
|
|
71
|
+
```html
|
|
72
|
+
<article class="
|
|
73
|
+
prose
|
|
74
|
+
prose-headings:text-blue-600
|
|
75
|
+
prose-a:text-blue-500
|
|
76
|
+
prose-a:no-underline
|
|
77
|
+
prose-code:text-pink-500
|
|
78
|
+
prose-img:rounded-lg
|
|
79
|
+
prose-strong:text-gray-900
|
|
80
|
+
prose-blockquote:border-blue-500
|
|
81
|
+
">
|
|
82
|
+
Content
|
|
83
|
+
</article>
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
#### Max Width Control
|
|
87
|
+
|
|
88
|
+
```html
|
|
89
|
+
<!-- Remove max-width constraint -->
|
|
90
|
+
<article class="prose max-w-none">
|
|
91
|
+
Full width content
|
|
92
|
+
</article>
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
#### Escaping Prose Styles
|
|
96
|
+
|
|
97
|
+
```html
|
|
98
|
+
<article class="prose">
|
|
99
|
+
<h1>Styled heading</h1>
|
|
100
|
+
<p>Styled paragraph</p>
|
|
101
|
+
|
|
102
|
+
<div class="not-prose">
|
|
103
|
+
<!-- This div and its children escape prose styles -->
|
|
104
|
+
<CustomComponent />
|
|
105
|
+
</div>
|
|
106
|
+
|
|
107
|
+
<p>Back to prose styles</p>
|
|
108
|
+
</article>
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
#### Custom Class Name
|
|
112
|
+
|
|
113
|
+
```css
|
|
114
|
+
@plugin "@tailwindcss/typography" {
|
|
115
|
+
className: wysiwyg;
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
```html
|
|
120
|
+
<article class="wysiwyg">Content</article>
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### @tailwindcss/forms
|
|
124
|
+
|
|
125
|
+
Resets form elements to a consistent, easily-styleable baseline.
|
|
126
|
+
|
|
127
|
+
#### Installation
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
npm install -D @tailwindcss/forms
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
```css
|
|
134
|
+
@import "tailwindcss";
|
|
135
|
+
@plugin "@tailwindcss/forms";
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
#### Styled Elements
|
|
139
|
+
|
|
140
|
+
The plugin applies styles to:
|
|
141
|
+
- `input[type='text']`
|
|
142
|
+
- `input[type='email']`
|
|
143
|
+
- `input[type='password']`
|
|
144
|
+
- `input[type='number']`
|
|
145
|
+
- `input[type='url']`
|
|
146
|
+
- `input[type='date']`
|
|
147
|
+
- `input[type='datetime-local']`
|
|
148
|
+
- `input[type='month']`
|
|
149
|
+
- `input[type='week']`
|
|
150
|
+
- `input[type='time']`
|
|
151
|
+
- `input[type='search']`
|
|
152
|
+
- `input[type='tel']`
|
|
153
|
+
- `input[type='checkbox']`
|
|
154
|
+
- `input[type='radio']`
|
|
155
|
+
- `select`
|
|
156
|
+
- `select[multiple]`
|
|
157
|
+
- `textarea`
|
|
158
|
+
|
|
159
|
+
#### Basic Usage
|
|
160
|
+
|
|
161
|
+
```html
|
|
162
|
+
<!-- Text input -->
|
|
163
|
+
<input type="email" class="rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500">
|
|
164
|
+
|
|
165
|
+
<!-- Select -->
|
|
166
|
+
<select class="rounded-lg border-gray-300">
|
|
167
|
+
<option>Option 1</option>
|
|
168
|
+
<option>Option 2</option>
|
|
169
|
+
</select>
|
|
170
|
+
|
|
171
|
+
<!-- Checkbox -->
|
|
172
|
+
<input type="checkbox" class="rounded text-blue-500 focus:ring-blue-500">
|
|
173
|
+
|
|
174
|
+
<!-- Radio -->
|
|
175
|
+
<input type="radio" class="text-blue-500 focus:ring-blue-500">
|
|
176
|
+
|
|
177
|
+
<!-- Textarea -->
|
|
178
|
+
<textarea class="rounded-lg border-gray-300" rows="4"></textarea>
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
#### Strategy: Class-Based
|
|
182
|
+
|
|
183
|
+
For opt-in styling (doesn't apply global resets):
|
|
184
|
+
|
|
185
|
+
```css
|
|
186
|
+
@plugin "@tailwindcss/forms" {
|
|
187
|
+
strategy: class;
|
|
188
|
+
}
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
```html
|
|
192
|
+
<!-- Explicitly opt-in to form styles -->
|
|
193
|
+
<input type="text" class="form-input rounded-lg">
|
|
194
|
+
<select class="form-select rounded-lg">
|
|
195
|
+
<textarea class="form-textarea rounded-lg">
|
|
196
|
+
<input type="checkbox" class="form-checkbox rounded">
|
|
197
|
+
<input type="radio" class="form-radio">
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
#### Form Classes Reference
|
|
201
|
+
|
|
202
|
+
| Class | Element |
|
|
203
|
+
|-------|---------|
|
|
204
|
+
| `form-input` | Text inputs |
|
|
205
|
+
| `form-textarea` | Textareas |
|
|
206
|
+
| `form-select` | Selects |
|
|
207
|
+
| `form-multiselect` | Multiple selects |
|
|
208
|
+
| `form-checkbox` | Checkboxes |
|
|
209
|
+
| `form-radio` | Radio buttons |
|
|
210
|
+
|
|
211
|
+
#### Styling Checkboxes/Radios
|
|
212
|
+
|
|
213
|
+
```html
|
|
214
|
+
<!-- Colored checkbox -->
|
|
215
|
+
<input type="checkbox" class="rounded text-pink-500">
|
|
216
|
+
|
|
217
|
+
<!-- Accent color (native) -->
|
|
218
|
+
<input type="checkbox" class="accent-purple-600">
|
|
219
|
+
|
|
220
|
+
<!-- Custom size -->
|
|
221
|
+
<input type="checkbox" class="h-6 w-6 rounded text-blue-500">
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### @tailwindcss/container-queries
|
|
225
|
+
|
|
226
|
+
Style elements based on their container's size instead of the viewport.
|
|
227
|
+
|
|
228
|
+
#### Installation
|
|
229
|
+
|
|
230
|
+
```bash
|
|
231
|
+
npm install -D @tailwindcss/container-queries
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
```css
|
|
235
|
+
@import "tailwindcss";
|
|
236
|
+
@plugin "@tailwindcss/container-queries";
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
#### Basic Usage
|
|
240
|
+
|
|
241
|
+
```html
|
|
242
|
+
<!-- Define a container -->
|
|
243
|
+
<div class="@container">
|
|
244
|
+
<!-- Use container query breakpoints -->
|
|
245
|
+
<div class="flex flex-col @md:flex-row @lg:gap-8">
|
|
246
|
+
<div class="@sm:text-lg @md:text-xl">
|
|
247
|
+
Responsive to container, not viewport
|
|
248
|
+
</div>
|
|
249
|
+
</div>
|
|
250
|
+
</div>
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
#### Container Breakpoints
|
|
254
|
+
|
|
255
|
+
| Prefix | Width |
|
|
256
|
+
|--------|-------|
|
|
257
|
+
| `@xs` | 320px |
|
|
258
|
+
| `@sm` | 384px |
|
|
259
|
+
| `@md` | 448px |
|
|
260
|
+
| `@lg` | 512px |
|
|
261
|
+
| `@xl` | 576px |
|
|
262
|
+
| `@2xl` | 672px |
|
|
263
|
+
| `@3xl` | 768px |
|
|
264
|
+
| `@4xl` | 896px |
|
|
265
|
+
| `@5xl` | 1024px |
|
|
266
|
+
| `@6xl` | 1152px |
|
|
267
|
+
| `@7xl` | 1280px |
|
|
268
|
+
|
|
269
|
+
#### Named Containers
|
|
270
|
+
|
|
271
|
+
```html
|
|
272
|
+
<!-- Name the container -->
|
|
273
|
+
<div class="@container/sidebar">
|
|
274
|
+
<!-- Reference by name -->
|
|
275
|
+
<div class="@md/sidebar:flex">
|
|
276
|
+
Only flex when sidebar container is md
|
|
277
|
+
</div>
|
|
278
|
+
</div>
|
|
279
|
+
|
|
280
|
+
<div class="@container/main">
|
|
281
|
+
<div class="@lg/main:grid-cols-3">
|
|
282
|
+
Grid when main container is lg
|
|
283
|
+
</div>
|
|
284
|
+
</div>
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
#### Arbitrary Container Values
|
|
288
|
+
|
|
289
|
+
```html
|
|
290
|
+
<div class="@container">
|
|
291
|
+
<div class="@[400px]:flex @[600px]:grid">
|
|
292
|
+
Arbitrary breakpoint values
|
|
293
|
+
</div>
|
|
294
|
+
</div>
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
## Creating Custom Plugins (v4)
|
|
298
|
+
|
|
299
|
+
### CSS-Only Utilities
|
|
300
|
+
|
|
301
|
+
For simple utilities, use the `@utility` directive instead of a JavaScript plugin:
|
|
302
|
+
|
|
303
|
+
```css
|
|
304
|
+
/* In your CSS file */
|
|
305
|
+
@utility content-auto {
|
|
306
|
+
content-visibility: auto;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
@utility text-balance {
|
|
310
|
+
text-wrap: balance;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
@utility scrollbar-none {
|
|
314
|
+
scrollbar-width: none;
|
|
315
|
+
-ms-overflow-style: none;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
@utility scrollbar-none::-webkit-scrollbar {
|
|
319
|
+
display: none;
|
|
320
|
+
}
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
### JavaScript Plugins
|
|
324
|
+
|
|
325
|
+
For complex plugins requiring JavaScript:
|
|
326
|
+
|
|
327
|
+
```javascript
|
|
328
|
+
// plugins/my-plugin.js
|
|
329
|
+
import plugin from 'tailwindcss/plugin'
|
|
330
|
+
|
|
331
|
+
export default plugin(function({ addUtilities, addComponents, matchUtilities, theme }) {
|
|
332
|
+
// Add static utilities
|
|
333
|
+
addUtilities({
|
|
334
|
+
'.content-auto': {
|
|
335
|
+
'content-visibility': 'auto',
|
|
336
|
+
},
|
|
337
|
+
'.text-balance': {
|
|
338
|
+
'text-wrap': 'balance',
|
|
339
|
+
},
|
|
340
|
+
})
|
|
341
|
+
|
|
342
|
+
// Add components
|
|
343
|
+
addComponents({
|
|
344
|
+
'.btn': {
|
|
345
|
+
padding: theme('spacing.2') + ' ' + theme('spacing.4'),
|
|
346
|
+
borderRadius: theme('borderRadius.lg'),
|
|
347
|
+
fontWeight: theme('fontWeight.medium'),
|
|
348
|
+
},
|
|
349
|
+
'.btn-primary': {
|
|
350
|
+
backgroundColor: theme('colors.blue.500'),
|
|
351
|
+
color: theme('colors.white'),
|
|
352
|
+
'&:hover': {
|
|
353
|
+
backgroundColor: theme('colors.blue.600'),
|
|
354
|
+
},
|
|
355
|
+
},
|
|
356
|
+
})
|
|
357
|
+
|
|
358
|
+
// Add dynamic utilities
|
|
359
|
+
matchUtilities(
|
|
360
|
+
{
|
|
361
|
+
'text-shadow': (value) => ({
|
|
362
|
+
textShadow: value,
|
|
363
|
+
}),
|
|
364
|
+
},
|
|
365
|
+
{ values: theme('textShadow') }
|
|
366
|
+
)
|
|
367
|
+
})
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
Load in CSS:
|
|
371
|
+
|
|
372
|
+
```css
|
|
373
|
+
@import "tailwindcss";
|
|
374
|
+
@plugin "./plugins/my-plugin.js";
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
### Plugin with Theme Extension
|
|
378
|
+
|
|
379
|
+
```javascript
|
|
380
|
+
// plugins/gradients.js
|
|
381
|
+
import plugin from 'tailwindcss/plugin'
|
|
382
|
+
|
|
383
|
+
export default plugin(
|
|
384
|
+
function({ matchUtilities, theme }) {
|
|
385
|
+
matchUtilities(
|
|
386
|
+
{
|
|
387
|
+
'text-gradient': (value) => ({
|
|
388
|
+
backgroundImage: value,
|
|
389
|
+
backgroundClip: 'text',
|
|
390
|
+
color: 'transparent',
|
|
391
|
+
}),
|
|
392
|
+
},
|
|
393
|
+
{ values: theme('textGradient') }
|
|
394
|
+
)
|
|
395
|
+
},
|
|
396
|
+
{
|
|
397
|
+
theme: {
|
|
398
|
+
textGradient: {
|
|
399
|
+
primary: 'linear-gradient(to right, #667eea, #764ba2)',
|
|
400
|
+
secondary: 'linear-gradient(to right, #f093fb, #f5576c)',
|
|
401
|
+
sunset: 'linear-gradient(to right, #fa709a, #fee140)',
|
|
402
|
+
},
|
|
403
|
+
},
|
|
404
|
+
}
|
|
405
|
+
)
|
|
406
|
+
```
|
|
407
|
+
|
|
408
|
+
### Adding Custom Variants
|
|
409
|
+
|
|
410
|
+
```javascript
|
|
411
|
+
// plugins/variants.js
|
|
412
|
+
import plugin from 'tailwindcss/plugin'
|
|
413
|
+
|
|
414
|
+
export default plugin(function({ addVariant }) {
|
|
415
|
+
// Peer states
|
|
416
|
+
addVariant('peer-checked', ':merge(.peer):checked ~ &')
|
|
417
|
+
|
|
418
|
+
// Group states
|
|
419
|
+
addVariant('group-focus-visible', ':merge(.group):focus-visible &')
|
|
420
|
+
|
|
421
|
+
// Data attributes
|
|
422
|
+
addVariant('data-active', '&[data-active="true"]')
|
|
423
|
+
addVariant('data-loading', '&[data-loading]')
|
|
424
|
+
|
|
425
|
+
// Custom selectors
|
|
426
|
+
addVariant('hocus', ['&:hover', '&:focus'])
|
|
427
|
+
addVariant('not-first', '&:not(:first-child)')
|
|
428
|
+
addVariant('not-last', '&:not(:last-child)')
|
|
429
|
+
})
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
## Community Plugins
|
|
433
|
+
|
|
434
|
+
### Popular Plugins
|
|
435
|
+
|
|
436
|
+
| Plugin | Description |
|
|
437
|
+
|--------|-------------|
|
|
438
|
+
| `tailwindcss-animate` | Animation utilities |
|
|
439
|
+
| `tailwindcss-motion` | Advanced motion/animation |
|
|
440
|
+
| `@headlessui/tailwindcss` | Headless UI variants |
|
|
441
|
+
| `tailwind-scrollbar` | Scrollbar styling |
|
|
442
|
+
| `tailwindcss-3d` | 3D transform utilities |
|
|
443
|
+
| `tailwindcss-fluid-type` | Fluid typography |
|
|
444
|
+
|
|
445
|
+
### tailwindcss-animate
|
|
446
|
+
|
|
447
|
+
```bash
|
|
448
|
+
npm install -D tailwindcss-animate
|
|
449
|
+
```
|
|
450
|
+
|
|
451
|
+
```css
|
|
452
|
+
@plugin "tailwindcss-animate";
|
|
453
|
+
```
|
|
454
|
+
|
|
455
|
+
```html
|
|
456
|
+
<div class="animate-in fade-in slide-in-from-bottom-4 duration-500">
|
|
457
|
+
Animated content
|
|
458
|
+
</div>
|
|
459
|
+
|
|
460
|
+
<div class="animate-out fade-out slide-out-to-top-4 duration-300">
|
|
461
|
+
Exiting content
|
|
462
|
+
</div>
|
|
463
|
+
```
|
|
464
|
+
|
|
465
|
+
## Best Practices
|
|
466
|
+
|
|
467
|
+
### 1. Load Only What You Need
|
|
468
|
+
|
|
469
|
+
```css
|
|
470
|
+
/* Only load plugins you actually use */
|
|
471
|
+
@plugin "@tailwindcss/typography";
|
|
472
|
+
/* @plugin "@tailwindcss/forms"; -- commented out if not using */
|
|
473
|
+
```
|
|
474
|
+
|
|
475
|
+
### 2. Use CSS Utilities First
|
|
476
|
+
|
|
477
|
+
Before creating a JavaScript plugin, try the `@utility` directive:
|
|
478
|
+
|
|
479
|
+
```css
|
|
480
|
+
/* Simple custom utility - no JS needed */
|
|
481
|
+
@utility glass {
|
|
482
|
+
backdrop-filter: blur(10px);
|
|
483
|
+
background: rgba(255, 255, 255, 0.1);
|
|
484
|
+
}
|
|
485
|
+
```
|
|
486
|
+
|
|
487
|
+
### 3. Document Custom Plugins
|
|
488
|
+
|
|
489
|
+
```javascript
|
|
490
|
+
/**
|
|
491
|
+
* @name Text Gradient Plugin
|
|
492
|
+
* @description Adds text gradient utilities
|
|
493
|
+
* @usage class="text-gradient-primary"
|
|
494
|
+
*/
|
|
495
|
+
export default plugin(...)
|
|
496
|
+
```
|
|
497
|
+
|
|
498
|
+
### 4. Test Plugin Compatibility
|
|
499
|
+
|
|
500
|
+
When upgrading Tailwind, verify all plugins work with the new version:
|
|
501
|
+
|
|
502
|
+
```bash
|
|
503
|
+
npm outdated | grep tailwind
|
|
504
|
+
npm update @tailwindcss/typography @tailwindcss/forms
|
|
505
|
+
```
|