create-huenei-template 0.2.2 → 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.
Files changed (87) hide show
  1. package/dist/config/templates.js +3 -3
  2. package/dist/templates/frontend/angular-base/.cursor/skills/angular-component/SKILL.md +288 -0
  3. package/dist/templates/frontend/angular-base/.cursor/skills/angular-component/references/component-patterns.md +358 -0
  4. package/dist/templates/frontend/angular-base/.cursor/skills/angular-di/SKILL.md +387 -0
  5. package/dist/templates/frontend/angular-base/.cursor/skills/angular-di/references/di-patterns.md +519 -0
  6. package/dist/templates/frontend/angular-base/.cursor/skills/angular-directives/SKILL.md +437 -0
  7. package/dist/templates/frontend/angular-base/.cursor/skills/angular-directives/references/directive-patterns.md +570 -0
  8. package/dist/templates/frontend/angular-base/.cursor/skills/angular-forms/SKILL.md +434 -0
  9. package/dist/templates/frontend/angular-base/.cursor/skills/angular-forms/references/form-patterns.md +398 -0
  10. package/dist/templates/frontend/angular-base/.cursor/skills/angular-http/SKILL.md +366 -0
  11. package/dist/templates/frontend/angular-base/.cursor/skills/angular-http/references/http-patterns.md +448 -0
  12. package/dist/templates/frontend/angular-base/.cursor/skills/angular-routing/SKILL.md +395 -0
  13. package/dist/templates/frontend/angular-base/.cursor/skills/angular-routing/references/routing-patterns.md +472 -0
  14. package/dist/templates/frontend/angular-base/.cursor/skills/angular-signals/SKILL.md +302 -0
  15. package/dist/templates/frontend/angular-base/.cursor/skills/angular-signals/references/signal-patterns.md +404 -0
  16. package/dist/templates/frontend/angular-base/.cursor/skills/angular-ssr/SKILL.md +435 -0
  17. package/dist/templates/frontend/angular-base/.cursor/skills/angular-ssr/references/ssr-patterns.md +497 -0
  18. package/dist/templates/frontend/angular-base/.cursor/skills/angular-testing/SKILL.md +660 -0
  19. package/dist/templates/frontend/angular-base/.cursor/skills/angular-testing/references/testing-patterns.md +707 -0
  20. package/dist/templates/frontend/angular-base/.cursor/skills/angular-tooling/SKILL.md +352 -0
  21. package/dist/templates/frontend/angular-base/.cursor/skills/angular-tooling/references/tooling-patterns.md +448 -0
  22. package/dist/templates/frontend/angular-base/.cursor/skills/tailwindcss-accessibility/SKILL.md +780 -0
  23. package/dist/templates/frontend/angular-base/.cursor/skills/tailwindcss-advanced-components/SKILL.md +718 -0
  24. package/dist/templates/frontend/angular-base/.cursor/skills/tailwindcss-advanced-design-systems/SKILL.md +612 -0
  25. package/dist/templates/frontend/angular-base/.cursor/skills/tailwindcss-advanced-layouts/SKILL.md +594 -0
  26. package/dist/templates/frontend/angular-base/.cursor/skills/tailwindcss-animations/SKILL.md +432 -0
  27. package/dist/templates/frontend/angular-base/.cursor/skills/tailwindcss-animations/references/animation-patterns.md +427 -0
  28. package/dist/templates/frontend/angular-base/.cursor/skills/tailwindcss-debugging/SKILL.md +354 -0
  29. package/dist/templates/frontend/angular-base/.cursor/skills/tailwindcss-debugging/references/troubleshooting-guide.md +306 -0
  30. package/dist/templates/frontend/angular-base/.cursor/skills/tailwindcss-framework-integration/SKILL.md +578 -0
  31. package/dist/templates/frontend/angular-base/.cursor/skills/tailwindcss-framework-integration/references/react-patterns.md +353 -0
  32. package/dist/templates/frontend/angular-base/.cursor/skills/tailwindcss-fundamentals-v4/SKILL.md +608 -0
  33. package/dist/templates/frontend/angular-base/.cursor/skills/tailwindcss-fundamentals-v4/references/advanced-theme-patterns.md +215 -0
  34. package/dist/templates/frontend/angular-base/.cursor/skills/tailwindcss-fundamentals-v4/references/custom-utilities-guide.md +281 -0
  35. package/dist/templates/frontend/angular-base/.cursor/skills/tailwindcss-mobile-first/SKILL.md +768 -0
  36. package/dist/templates/frontend/angular-base/.cursor/skills/tailwindcss-performance/SKILL.md +374 -0
  37. package/dist/templates/frontend/angular-base/.cursor/skills/tailwindcss-performance/references/bundle-optimization.md +244 -0
  38. package/dist/templates/frontend/angular-base/.cursor/skills/tailwindcss-plugins/SKILL.md +505 -0
  39. package/dist/templates/frontend/angular-base/.cursor/skills/tailwindcss-responsive-darkmode/SKILL.md +601 -0
  40. package/dist/templates/frontend/angular-base/.cursor/skills/tailwindcss-responsive-darkmode/references/advanced-responsive-patterns.md +485 -0
  41. package/dist/templates/frontend/angular-base/.cursor/skills/web-design-guidelines/SKILL.md +39 -0
  42. package/dist/templates/frontend/angular-base/package.json +0 -1
  43. package/dist/templates/frontend/angular-base/pnpm-lock.yaml +8183 -0
  44. package/package.json +1 -1
  45. package/templates/frontend/angular-base/.cursor/skills/angular-component/SKILL.md +288 -0
  46. package/templates/frontend/angular-base/.cursor/skills/angular-component/references/component-patterns.md +358 -0
  47. package/templates/frontend/angular-base/.cursor/skills/angular-di/SKILL.md +387 -0
  48. package/templates/frontend/angular-base/.cursor/skills/angular-di/references/di-patterns.md +519 -0
  49. package/templates/frontend/angular-base/.cursor/skills/angular-directives/SKILL.md +437 -0
  50. package/templates/frontend/angular-base/.cursor/skills/angular-directives/references/directive-patterns.md +570 -0
  51. package/templates/frontend/angular-base/.cursor/skills/angular-forms/SKILL.md +434 -0
  52. package/templates/frontend/angular-base/.cursor/skills/angular-forms/references/form-patterns.md +398 -0
  53. package/templates/frontend/angular-base/.cursor/skills/angular-http/SKILL.md +366 -0
  54. package/templates/frontend/angular-base/.cursor/skills/angular-http/references/http-patterns.md +448 -0
  55. package/templates/frontend/angular-base/.cursor/skills/angular-routing/SKILL.md +395 -0
  56. package/templates/frontend/angular-base/.cursor/skills/angular-routing/references/routing-patterns.md +472 -0
  57. package/templates/frontend/angular-base/.cursor/skills/angular-signals/SKILL.md +302 -0
  58. package/templates/frontend/angular-base/.cursor/skills/angular-signals/references/signal-patterns.md +404 -0
  59. package/templates/frontend/angular-base/.cursor/skills/angular-ssr/SKILL.md +435 -0
  60. package/templates/frontend/angular-base/.cursor/skills/angular-ssr/references/ssr-patterns.md +497 -0
  61. package/templates/frontend/angular-base/.cursor/skills/angular-testing/SKILL.md +660 -0
  62. package/templates/frontend/angular-base/.cursor/skills/angular-testing/references/testing-patterns.md +707 -0
  63. package/templates/frontend/angular-base/.cursor/skills/angular-tooling/SKILL.md +352 -0
  64. package/templates/frontend/angular-base/.cursor/skills/angular-tooling/references/tooling-patterns.md +448 -0
  65. package/templates/frontend/angular-base/.cursor/skills/tailwindcss-accessibility/SKILL.md +780 -0
  66. package/templates/frontend/angular-base/.cursor/skills/tailwindcss-advanced-components/SKILL.md +718 -0
  67. package/templates/frontend/angular-base/.cursor/skills/tailwindcss-advanced-design-systems/SKILL.md +612 -0
  68. package/templates/frontend/angular-base/.cursor/skills/tailwindcss-advanced-layouts/SKILL.md +594 -0
  69. package/templates/frontend/angular-base/.cursor/skills/tailwindcss-animations/SKILL.md +432 -0
  70. package/templates/frontend/angular-base/.cursor/skills/tailwindcss-animations/references/animation-patterns.md +427 -0
  71. package/templates/frontend/angular-base/.cursor/skills/tailwindcss-debugging/SKILL.md +354 -0
  72. package/templates/frontend/angular-base/.cursor/skills/tailwindcss-debugging/references/troubleshooting-guide.md +306 -0
  73. package/templates/frontend/angular-base/.cursor/skills/tailwindcss-framework-integration/SKILL.md +578 -0
  74. package/templates/frontend/angular-base/.cursor/skills/tailwindcss-framework-integration/references/react-patterns.md +353 -0
  75. package/templates/frontend/angular-base/.cursor/skills/tailwindcss-fundamentals-v4/SKILL.md +608 -0
  76. package/templates/frontend/angular-base/.cursor/skills/tailwindcss-fundamentals-v4/references/advanced-theme-patterns.md +215 -0
  77. package/templates/frontend/angular-base/.cursor/skills/tailwindcss-fundamentals-v4/references/custom-utilities-guide.md +281 -0
  78. package/templates/frontend/angular-base/.cursor/skills/tailwindcss-mobile-first/SKILL.md +768 -0
  79. package/templates/frontend/angular-base/.cursor/skills/tailwindcss-performance/SKILL.md +374 -0
  80. package/templates/frontend/angular-base/.cursor/skills/tailwindcss-performance/references/bundle-optimization.md +244 -0
  81. package/templates/frontend/angular-base/.cursor/skills/tailwindcss-plugins/SKILL.md +505 -0
  82. package/templates/frontend/angular-base/.cursor/skills/tailwindcss-responsive-darkmode/SKILL.md +601 -0
  83. package/templates/frontend/angular-base/.cursor/skills/tailwindcss-responsive-darkmode/references/advanced-responsive-patterns.md +485 -0
  84. package/templates/frontend/angular-base/.cursor/skills/web-design-guidelines/SKILL.md +39 -0
  85. package/templates/frontend/angular-base/package.json +0 -1
  86. package/templates/frontend/angular-base/pnpm-lock.yaml +8183 -0
  87. package/templates/frontend/angular-base/package-lock.json +0 -13321
@@ -0,0 +1,780 @@
1
+ ---
2
+ name: tailwindcss-accessibility
3
+ description: Tailwind CSS accessibility patterns including WCAG 2.2 compliance, touch targets, focus management, and ARIA support
4
+ ---
5
+
6
+ # Tailwind CSS Accessibility Patterns (WCAG 2.2 - 2025/2026)
7
+
8
+ ## WCAG 2.2 Overview (Current Standard)
9
+
10
+ WCAG 2.2 was released October 2023 and is the current W3C standard. Key additions relevant to Tailwind:
11
+
12
+ - **2.5.8 Target Size (Level AA)**: 24x24 CSS pixels minimum, 44x44 recommended
13
+ - **2.4.11 Focus Not Obscured**: Focus indicators must be visible
14
+ - **2.4.13 Focus Appearance**: Enhanced focus indicator requirements
15
+ - **3.3.7 Redundant Entry**: Don't require re-entering information
16
+ - **3.2.6 Consistent Help**: Help mechanisms in consistent locations
17
+
18
+ ## Focus Management
19
+
20
+ ### Focus Ring Utilities
21
+
22
+ ```html
23
+ <!-- Default focus ring -->
24
+ <button class="focus:outline-none focus:ring-2 focus:ring-brand-500 focus:ring-offset-2">
25
+ Button
26
+ </button>
27
+
28
+ <!-- Focus-visible for keyboard users only -->
29
+ <button class="focus:outline-none focus-visible:ring-2 focus-visible:ring-brand-500">
30
+ Only shows ring for keyboard focus
31
+ </button>
32
+
33
+ <!-- Focus-within for parent containers -->
34
+ <div class="focus-within:ring-2 focus-within:ring-brand-500 rounded-lg p-1">
35
+ <input type="text" class="border-none focus:outline-none" />
36
+ </div>
37
+
38
+ <!-- Custom focus ring component -->
39
+ ```
40
+
41
+ ```css
42
+ @layer components {
43
+ .focus-ring {
44
+ @apply focus:outline-none focus-visible:ring-2 focus-visible:ring-brand-500 focus-visible:ring-offset-2;
45
+ }
46
+
47
+ .focus-ring-inset {
48
+ @apply focus:outline-none focus-visible:ring-2 focus-visible:ring-brand-500 focus-visible:ring-inset;
49
+ }
50
+ }
51
+ ```
52
+
53
+ ### Skip Links
54
+
55
+ ```html
56
+ <!-- Skip to main content -->
57
+ <a
58
+ href="#main-content"
59
+ class="
60
+ sr-only focus:not-sr-only
61
+ focus:absolute focus:top-4 focus:left-4 focus:z-50
62
+ focus:bg-white focus:px-4 focus:py-2 focus:rounded-md focus:shadow-lg
63
+ focus:ring-2 focus:ring-brand-500
64
+ "
65
+ >
66
+ Skip to main content
67
+ </a>
68
+
69
+ <header>Navigation...</header>
70
+ <main id="main-content" tabindex="-1">
71
+ Main content
72
+ </main>
73
+ ```
74
+
75
+ ### Focus Trap Pattern
76
+
77
+ ```html
78
+ <!-- Modal with focus management -->
79
+ <div
80
+ role="dialog"
81
+ aria-modal="true"
82
+ aria-labelledby="modal-title"
83
+ class="fixed inset-0 z-50 flex items-center justify-center"
84
+ >
85
+ <div class="fixed inset-0 bg-black/50" aria-hidden="true"></div>
86
+ <div
87
+ class="relative bg-white rounded-xl p-6 max-w-md w-full"
88
+ role="document"
89
+ >
90
+ <h2 id="modal-title" class="text-lg font-semibold">Modal Title</h2>
91
+ <p>Modal content</p>
92
+ <button class="focus-ring">Close</button>
93
+ </div>
94
+ </div>
95
+ ```
96
+
97
+ ## Screen Reader Utilities
98
+
99
+ ### Visually Hidden Content
100
+
101
+ ```html
102
+ <!-- Hidden visually but available to screen readers -->
103
+ <span class="sr-only">Additional context for screen readers</span>
104
+
105
+ <!-- Show on focus (skip links) -->
106
+ <a href="#main" class="sr-only focus:not-sr-only">Skip to main</a>
107
+
108
+ <!-- Icon with accessible label -->
109
+ <button>
110
+ <svg aria-hidden="true">...</svg>
111
+ <span class="sr-only">Close menu</span>
112
+ </button>
113
+
114
+ <!-- Form labels -->
115
+ <label>
116
+ <span class="sr-only">Search</span>
117
+ <input type="search" placeholder="Search..." />
118
+ </label>
119
+ ```
120
+
121
+ ### Announcing Dynamic Content
122
+
123
+ ```html
124
+ <!-- Live region for announcements -->
125
+ <div
126
+ role="status"
127
+ aria-live="polite"
128
+ aria-atomic="true"
129
+ class="sr-only"
130
+ >
131
+ <!-- Dynamic content announced to screen readers -->
132
+ 3 items added to cart
133
+ </div>
134
+
135
+ <!-- Alert for important messages -->
136
+ <div
137
+ role="alert"
138
+ aria-live="assertive"
139
+ class="bg-red-100 text-red-800 p-4 rounded-lg"
140
+ >
141
+ Error: Please correct the form
142
+ </div>
143
+ ```
144
+
145
+ ## Color Contrast
146
+
147
+ ### High Contrast Patterns
148
+
149
+ ```html
150
+ <!-- Ensure sufficient contrast -->
151
+ <p class="text-gray-700 bg-white">4.5:1 contrast ratio</p>
152
+ <p class="text-gray-500 bg-white">May not meet WCAG AA (3:1 min for large text)</p>
153
+
154
+ <!-- Large text (18pt+) needs 3:1 -->
155
+ <h1 class="text-4xl text-gray-600 bg-white">Large text - 3:1 ratio OK</h1>
156
+
157
+ <!-- Interactive elements need 3:1 against adjacent colors -->
158
+ <button class="
159
+ bg-brand-500 text-white
160
+ border-2 border-brand-500
161
+ focus:ring-2 focus:ring-brand-500 focus:ring-offset-2
162
+ ">
163
+ Accessible Button
164
+ </button>
165
+ ```
166
+
167
+ ### Dark Mode Contrast
168
+
169
+ ```html
170
+ <!-- Maintain contrast in both modes -->
171
+ <p class="text-gray-900 dark:text-gray-100">
172
+ High contrast text
173
+ </p>
174
+
175
+ <p class="text-gray-600 dark:text-gray-400">
176
+ Secondary text with adequate contrast
177
+ </p>
178
+
179
+ <!-- Avoid low contrast combinations -->
180
+ <p class="text-gray-400 dark:text-gray-600">
181
+ ⚠️ May have contrast issues in dark mode
182
+ </p>
183
+ ```
184
+
185
+ ### Focus Indicator Contrast
186
+
187
+ ```css
188
+ @theme {
189
+ /* High contrast focus ring */
190
+ --color-focus: oklch(0.55 0.25 250);
191
+ --color-focus-offset: oklch(1 0 0);
192
+ }
193
+ ```
194
+
195
+ ```html
196
+ <button class="
197
+ focus:outline-none
198
+ focus-visible:ring-2
199
+ focus-visible:ring-[var(--color-focus)]
200
+ focus-visible:ring-offset-2
201
+ focus-visible:ring-offset-[var(--color-focus-offset)]
202
+ ">
203
+ High contrast focus
204
+ </button>
205
+ ```
206
+
207
+ ## Motion and Animation
208
+
209
+ ### Reduced Motion
210
+
211
+ ```html
212
+ <!-- Respect user's motion preferences -->
213
+ <div class="
214
+ animate-bounce
215
+ motion-reduce:animate-none
216
+ ">
217
+ Bouncing element (static for motion-sensitive users)
218
+ </div>
219
+
220
+ <!-- Safer alternative animations -->
221
+ <div class="
222
+ transition-opacity duration-300
223
+ motion-reduce:transition-none
224
+ ">
225
+ Fades in (instant for motion-sensitive)
226
+ </div>
227
+
228
+ <!-- Use opacity instead of movement -->
229
+ <div class="
230
+ transition-all
231
+ hover:scale-105 hover:shadow-lg
232
+ motion-reduce:hover:scale-100 motion-reduce:hover:shadow-md
233
+ ">
234
+ Scales on hover (shadow only for motion-sensitive)
235
+ </div>
236
+ ```
237
+
238
+ ### Safe Animation Patterns
239
+
240
+ ```css
241
+ @layer components {
242
+ /* Animations that respect reduced motion */
243
+ .animate-fade-in {
244
+ @apply animate-in fade-in duration-300;
245
+ @apply motion-reduce:animate-none motion-reduce:opacity-100;
246
+ }
247
+
248
+ .animate-slide-up {
249
+ @apply animate-in slide-in-from-bottom-4 duration-300;
250
+ @apply motion-reduce:animate-none motion-reduce:translate-y-0;
251
+ }
252
+ }
253
+ ```
254
+
255
+ ### Pause Animation on Hover
256
+
257
+ ```html
258
+ <!-- Allow users to pause animations -->
259
+ <div class="
260
+ animate-spin
261
+ hover:animate-pause
262
+ motion-reduce:animate-none
263
+ ">
264
+ Loading spinner
265
+ </div>
266
+ ```
267
+
268
+ ## Form Accessibility
269
+
270
+ ### Accessible Form Fields
271
+
272
+ ```html
273
+ <div class="space-y-4">
274
+ <!-- Text input with label -->
275
+ <div>
276
+ <label for="email" class="block text-sm font-medium text-gray-700">
277
+ Email address
278
+ <span class="text-red-500" aria-hidden="true">*</span>
279
+ </label>
280
+ <input
281
+ type="email"
282
+ id="email"
283
+ name="email"
284
+ required
285
+ aria-required="true"
286
+ aria-describedby="email-hint email-error"
287
+ class="
288
+ mt-1 block w-full rounded-md border-gray-300
289
+ focus:border-brand-500 focus:ring-brand-500
290
+ aria-invalid:border-red-500 aria-invalid:ring-red-500
291
+ "
292
+ />
293
+ <p id="email-hint" class="mt-1 text-sm text-gray-500">
294
+ We'll never share your email
295
+ </p>
296
+ <p id="email-error" class="mt-1 text-sm text-red-600 hidden" role="alert">
297
+ Please enter a valid email
298
+ </p>
299
+ </div>
300
+
301
+ <!-- Checkbox with accessible label -->
302
+ <div class="flex items-start gap-3">
303
+ <input
304
+ type="checkbox"
305
+ id="terms"
306
+ name="terms"
307
+ class="
308
+ h-4 w-4 rounded border-gray-300 text-brand-500
309
+ focus:ring-brand-500
310
+ "
311
+ />
312
+ <label for="terms" class="text-sm text-gray-700">
313
+ I agree to the
314
+ <a href="/terms" class="text-brand-500 underline">terms and conditions</a>
315
+ </label>
316
+ </div>
317
+
318
+ <!-- Radio group -->
319
+ <fieldset>
320
+ <legend class="text-sm font-medium text-gray-700">Notification preference</legend>
321
+ <div class="mt-2 space-y-2">
322
+ <div class="flex items-center gap-3">
323
+ <input type="radio" id="email-pref" name="notification" value="email" class="h-4 w-4" />
324
+ <label for="email-pref">Email</label>
325
+ </div>
326
+ <div class="flex items-center gap-3">
327
+ <input type="radio" id="sms-pref" name="notification" value="sms" class="h-4 w-4" />
328
+ <label for="sms-pref">SMS</label>
329
+ </div>
330
+ </div>
331
+ </fieldset>
332
+ </div>
333
+ ```
334
+
335
+ ### Error States
336
+
337
+ ```html
338
+ <!-- Input with error -->
339
+ <div>
340
+ <label for="password" class="block text-sm font-medium text-gray-700">
341
+ Password
342
+ </label>
343
+ <input
344
+ type="password"
345
+ id="password"
346
+ aria-invalid="true"
347
+ aria-describedby="password-error"
348
+ class="
349
+ mt-1 block w-full rounded-md
350
+ border-red-500 text-red-900
351
+ focus:border-red-500 focus:ring-red-500
352
+ "
353
+ />
354
+ <p id="password-error" class="mt-1 text-sm text-red-600" role="alert">
355
+ <span class="sr-only">Error:</span>
356
+ Password must be at least 8 characters
357
+ </p>
358
+ </div>
359
+ ```
360
+
361
+ ### Form Validation Feedback
362
+
363
+ ```css
364
+ /* Style based on aria-invalid attribute */
365
+ @custom-variant aria-invalid (&[aria-invalid="true"]);
366
+ ```
367
+
368
+ ```html
369
+ <input
370
+ class="
371
+ border-gray-300
372
+ aria-invalid:border-red-500
373
+ aria-invalid:text-red-900
374
+ aria-invalid:focus:ring-red-500
375
+ "
376
+ aria-invalid="true"
377
+ />
378
+ ```
379
+
380
+ ## Interactive Components
381
+
382
+ ### Accessible Buttons
383
+
384
+ ```html
385
+ <!-- Button with loading state -->
386
+ <button
387
+ type="submit"
388
+ aria-busy="true"
389
+ aria-disabled="true"
390
+ class="
391
+ relative
392
+ aria-busy:cursor-wait
393
+ aria-disabled:opacity-50 aria-disabled:cursor-not-allowed
394
+ "
395
+ >
396
+ <span class="aria-busy:invisible">Submit</span>
397
+ <span class="absolute inset-0 flex items-center justify-center aria-busy:visible invisible">
398
+ <svg class="animate-spin h-5 w-5" aria-hidden="true">...</svg>
399
+ <span class="sr-only">Loading...</span>
400
+ </span>
401
+ </button>
402
+
403
+ <!-- Icon button -->
404
+ <button
405
+ type="button"
406
+ aria-label="Close dialog"
407
+ class="rounded-full p-2 hover:bg-gray-100 focus-ring"
408
+ >
409
+ <svg aria-hidden="true" class="h-5 w-5">...</svg>
410
+ </button>
411
+
412
+ <!-- Toggle button -->
413
+ <button
414
+ type="button"
415
+ aria-pressed="false"
416
+ class="
417
+ px-4 py-2 rounded-lg border
418
+ aria-pressed:bg-brand-500 aria-pressed:text-white aria-pressed:border-brand-500
419
+ "
420
+ >
421
+ <span class="sr-only">Toggle feature</span>
422
+ Feature
423
+ </button>
424
+ ```
425
+
426
+ ### Accessible Dropdowns
427
+
428
+ ```html
429
+ <div class="relative">
430
+ <button
431
+ type="button"
432
+ aria-haspopup="menu"
433
+ aria-expanded="false"
434
+ aria-controls="dropdown-menu"
435
+ class="flex items-center gap-2 px-4 py-2 rounded-lg border focus-ring"
436
+ >
437
+ Options
438
+ <svg aria-hidden="true" class="h-4 w-4">...</svg>
439
+ </button>
440
+
441
+ <ul
442
+ id="dropdown-menu"
443
+ role="menu"
444
+ aria-labelledby="dropdown-button"
445
+ class="
446
+ absolute top-full mt-1 w-48 rounded-lg bg-white shadow-lg border
447
+ hidden aria-expanded:block
448
+ "
449
+ >
450
+ <li role="none">
451
+ <a
452
+ href="#"
453
+ role="menuitem"
454
+ tabindex="-1"
455
+ class="block px-4 py-2 hover:bg-gray-100 focus:bg-gray-100 focus:outline-none"
456
+ >
457
+ Edit
458
+ </a>
459
+ </li>
460
+ <li role="none">
461
+ <a
462
+ href="#"
463
+ role="menuitem"
464
+ tabindex="-1"
465
+ class="block px-4 py-2 hover:bg-gray-100 focus:bg-gray-100 focus:outline-none"
466
+ >
467
+ Delete
468
+ </a>
469
+ </li>
470
+ </ul>
471
+ </div>
472
+ ```
473
+
474
+ ### Accessible Tabs
475
+
476
+ ```html
477
+ <div>
478
+ <div role="tablist" aria-label="Account settings" class="flex border-b">
479
+ <button
480
+ role="tab"
481
+ aria-selected="true"
482
+ aria-controls="panel-1"
483
+ id="tab-1"
484
+ class="
485
+ px-4 py-2 border-b-2
486
+ aria-selected:border-brand-500 aria-selected:text-brand-500
487
+ hover:text-gray-700
488
+ focus-visible:ring-2 focus-visible:ring-inset
489
+ "
490
+ >
491
+ Profile
492
+ </button>
493
+ <button
494
+ role="tab"
495
+ aria-selected="false"
496
+ aria-controls="panel-2"
497
+ id="tab-2"
498
+ tabindex="-1"
499
+ class="px-4 py-2 border-b-2 border-transparent"
500
+ >
501
+ Settings
502
+ </button>
503
+ </div>
504
+
505
+ <div
506
+ role="tabpanel"
507
+ id="panel-1"
508
+ aria-labelledby="tab-1"
509
+ tabindex="0"
510
+ class="p-4 focus:outline-none focus-visible:ring-2 focus-visible:ring-inset"
511
+ >
512
+ Profile content
513
+ </div>
514
+
515
+ <div
516
+ role="tabpanel"
517
+ id="panel-2"
518
+ aria-labelledby="tab-2"
519
+ tabindex="0"
520
+ hidden
521
+ class="p-4"
522
+ >
523
+ Settings content
524
+ </div>
525
+ </div>
526
+ ```
527
+
528
+ ## Touch Targets (WCAG 2.2 - Critical for 2025/2026)
529
+
530
+ ### WCAG 2.2 Target Size Requirements
531
+
532
+ | Level | Requirement | Tailwind Class |
533
+ |-------|-------------|----------------|
534
+ | **AA (2.5.8)** | 24x24 CSS pixels minimum | `min-h-6 min-w-6` |
535
+ | **Recommended** | 44x44 CSS pixels | `min-h-11 min-w-11` |
536
+ | **AAA (2.5.5)** | 44x44 CSS pixels | `min-h-11 min-w-11` |
537
+ | **Optimal** | 48x48 CSS pixels | `min-h-12 min-w-12` |
538
+
539
+ Platform guidelines comparison:
540
+ - **Apple iOS**: 44x44 points minimum
541
+ - **Google Android**: 48x48 dp minimum
542
+ - **Microsoft Fluent**: 44x44 pixels minimum
543
+
544
+ ### Minimum Touch Target Size
545
+
546
+ ```html
547
+ <!-- WCAG 2.2 Level AA minimum (24px) -->
548
+ <button class="min-h-6 min-w-6 p-1">
549
+ <svg class="h-4 w-4">...</svg>
550
+ </button>
551
+
552
+ <!-- Recommended size (44px) - preferred for mobile -->
553
+ <button class="min-h-11 min-w-11 p-2.5">
554
+ <svg class="h-6 w-6" aria-hidden="true">...</svg>
555
+ <span class="sr-only">Action</span>
556
+ </button>
557
+
558
+ <!-- Optimal for primary actions (48px) -->
559
+ <button class="min-h-12 min-w-12 px-6 py-3 text-base font-medium">
560
+ Primary Action
561
+ </button>
562
+ ```
563
+
564
+ ### Extend Touch Target Beyond Visible Element
565
+
566
+ ```html
567
+ <!-- Small visible link with extended tap area -->
568
+ <a href="#" class="relative inline-block text-sm">
569
+ Small Link Text
570
+ <span class="absolute -inset-3" aria-hidden="true"></span>
571
+ </a>
572
+
573
+ <!-- Icon button with extended target -->
574
+ <button class="relative p-2 -m-2 rounded-lg hover:bg-gray-100">
575
+ <svg class="h-5 w-5" aria-hidden="true">...</svg>
576
+ <span class="sr-only">Close menu</span>
577
+ </button>
578
+
579
+ <!-- Card with full-surface tap target -->
580
+ <article class="relative p-4 rounded-lg border hover:shadow-md">
581
+ <h3>Card Title</h3>
582
+ <p>Description text</p>
583
+ <a href="/details" class="after:absolute after:inset-0">
584
+ <span class="sr-only">View details</span>
585
+ </a>
586
+ </article>
587
+ ```
588
+
589
+ ### Spacing Between Interactive Elements
590
+
591
+ WCAG 2.2 requires 24px spacing OR targets must be 24px minimum:
592
+
593
+ ```html
594
+ <!-- Adequate spacing between touch targets (12px gap minimum) -->
595
+ <div class="flex gap-3">
596
+ <button class="min-h-11 px-4 py-2">Button 1</button>
597
+ <button class="min-h-11 px-4 py-2">Button 2</button>
598
+ </div>
599
+
600
+ <!-- Stacked links with adequate height and spacing -->
601
+ <nav class="flex flex-col">
602
+ <a href="#" class="py-3 px-4 min-h-11 border-b border-gray-100">Link 1</a>
603
+ <a href="#" class="py-3 px-4 min-h-11 border-b border-gray-100">Link 2</a>
604
+ <a href="#" class="py-3 px-4 min-h-11">Link 3</a>
605
+ </nav>
606
+
607
+ <!-- Button group with safe spacing -->
608
+ <div class="flex flex-wrap gap-3">
609
+ <button class="min-h-11 px-4 py-2 border rounded-lg">Cancel</button>
610
+ <button class="min-h-11 px-4 py-2 bg-blue-600 text-white rounded-lg">Confirm</button>
611
+ </div>
612
+ ```
613
+
614
+ ### Touch Target Exceptions (WCAG 2.2)
615
+
616
+ Targets can be smaller than 24x24 if:
617
+ - Inline text links within sentences
618
+ - Browser-provided controls (scrollbars)
619
+ - Size is essential to information
620
+ - A larger equivalent target exists on same page
621
+
622
+ ## Text Accessibility
623
+
624
+ ### Readable Text
625
+
626
+ ```html
627
+ <!-- Adequate line height for body text -->
628
+ <p class="leading-relaxed">
629
+ Long form content with comfortable line height
630
+ </p>
631
+
632
+ <!-- Limit line length for readability -->
633
+ <article class="max-w-prose">
634
+ <p class="leading-relaxed">
635
+ Content with optimal line length (45-75 characters)
636
+ </p>
637
+ </article>
638
+
639
+ <!-- Adequate paragraph spacing -->
640
+ <div class="space-y-6">
641
+ <p>Paragraph 1</p>
642
+ <p>Paragraph 2</p>
643
+ </div>
644
+ ```
645
+
646
+ ### Text Resizing
647
+
648
+ ```html
649
+ <!-- Use relative units for text -->
650
+ <p class="text-base">Scales with user's font size preferences</p>
651
+
652
+ <!-- Don't use fixed pixel values for text -->
653
+ <p class="text-[14px]">⚠️ Won't scale with browser zoom</p>
654
+
655
+ <!-- Container that doesn't break on text zoom -->
656
+ <div class="min-h-[auto]">
657
+ Content height adjusts with text size
658
+ </div>
659
+ ```
660
+
661
+ ## Semantic HTML with Tailwind
662
+
663
+ ### Landmark Regions
664
+
665
+ ```html
666
+ <body class="min-h-screen flex flex-col">
667
+ <header class="sticky top-0 bg-white shadow z-50">
668
+ <nav aria-label="Main navigation">...</nav>
669
+ </header>
670
+
671
+ <main id="main-content" class="flex-1">
672
+ <article>
673
+ <h1>Page Title</h1>
674
+ <section aria-labelledby="section-1">
675
+ <h2 id="section-1">Section Title</h2>
676
+ <p>Content...</p>
677
+ </section>
678
+ </article>
679
+
680
+ <aside aria-label="Related content" class="hidden lg:block">
681
+ Sidebar content
682
+ </aside>
683
+ </main>
684
+
685
+ <footer class="bg-gray-800 text-white">
686
+ <nav aria-label="Footer navigation">...</nav>
687
+ </footer>
688
+ </body>
689
+ ```
690
+
691
+ ### Heading Hierarchy
692
+
693
+ ```html
694
+ <article class="prose">
695
+ <h1 class="text-4xl font-bold">Main Title (H1)</h1>
696
+
697
+ <section>
698
+ <h2 class="text-2xl font-semibold">Section (H2)</h2>
699
+
700
+ <section>
701
+ <h3 class="text-xl font-medium">Subsection (H3)</h3>
702
+ <p>Content...</p>
703
+ </section>
704
+ </section>
705
+ </article>
706
+ ```
707
+
708
+ ## Testing Accessibility
709
+
710
+ ### Browser DevTools Checklist
711
+
712
+ 1. **Color contrast**: Use contrast checker
713
+ 2. **Focus order**: Tab through the page
714
+ 3. **Zoom**: Test at 200% zoom
715
+ 4. **Reduced motion**: Enable in OS settings
716
+
717
+ ### Automated Testing
718
+
719
+ ```javascript
720
+ // axe-core integration
721
+ import { axe, toHaveNoViolations } from 'jest-axe';
722
+
723
+ expect.extend(toHaveNoViolations);
724
+
725
+ test('component is accessible', async () => {
726
+ const { container } = render(<Component />);
727
+ const results = await axe(container);
728
+ expect(results).toHaveNoViolations();
729
+ });
730
+ ```
731
+
732
+ ## Best Practices Summary (WCAG 2.2 - 2025/2026)
733
+
734
+ | Pattern | Implementation | WCAG Level |
735
+ |---------|---------------|------------|
736
+ | Focus visible | `focus-visible:ring-2 focus-visible:ring-offset-2` | 2.4.7 (AA) |
737
+ | Screen reader only | `sr-only` | 1.3.1 (A) |
738
+ | Skip links | `sr-only focus:not-sr-only focus:absolute` | 2.4.1 (A) |
739
+ | Reduced motion | `motion-reduce:animate-none motion-reduce:transition-none` | 2.3.3 (AAA) |
740
+ | Touch targets (min) | `min-h-6 min-w-6` (24px) | 2.5.8 (AA) |
741
+ | Touch targets (rec) | `min-h-11 min-w-11` (44px) | 2.5.5 (AAA) |
742
+ | Touch spacing | `gap-3` (12px minimum between targets) | 2.5.8 (AA) |
743
+ | Text contrast | 4.5:1 for normal, 3:1 for large text | 1.4.3 (AA) |
744
+ | Form errors | `aria-invalid="true"` + `role="alert"` | 3.3.1 (A) |
745
+ | Focus not obscured | Avoid `z-index` covering focused elements | 2.4.11 (AA) |
746
+
747
+ ### Quick Reference: Touch-Friendly Component
748
+
749
+ ```html
750
+ <!-- Accessible, touch-friendly button component -->
751
+ <button
752
+ type="button"
753
+ class="
754
+ /* Touch target size (44px minimum) */
755
+ min-h-11 min-w-11 px-4 py-2.5
756
+
757
+ /* Typography */
758
+ text-sm md:text-base font-medium
759
+
760
+ /* Colors with sufficient contrast */
761
+ bg-blue-600 text-white
762
+ hover:bg-blue-700
763
+
764
+ /* Focus indicator (visible, not obscured) */
765
+ focus:outline-none
766
+ focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2
767
+
768
+ /* Shape */
769
+ rounded-lg
770
+
771
+ /* Disabled state */
772
+ disabled:opacity-50 disabled:cursor-not-allowed
773
+
774
+ /* Respect motion preferences */
775
+ transition-colors motion-reduce:transition-none
776
+ "
777
+ >
778
+ Button Text
779
+ </button>
780
+ ```