tailwindcss-plugins
Tailwind CSS plugins — official plugins and custom plugin development. PROACTIVELY activate for: (1) @tailwindcss/typography (prose), (2) @tailwindcss/forms, (3) @tailwindcss/aspect-ratio (now built-in), (4) @tailwindcss/container-queries, (5) writing custom plugins via plugin() API, (6) addUtilities, addComponents, addVariant from plugin API, (7) third-party plugins (tailwindcss-animate, tailwind-merge), (8) in-CSS @utility and @variant in v4 (often replaces JS plugins), (9) plugin migration from v3 JS API to v4 CSS API. Provides: official plugin install/setup, plugin API reference, custom plugin examples, and v3-to-v4 plugin migration guide.
What this skill does
# Tailwind CSS Plugins
## Official Plugins
### @tailwindcss/typography
Beautiful typographic defaults for content you don't control (Markdown, CMS content).
#### Installation
```bash
npm install -D @tailwindcss/typography
```
```css
@import "tailwindcss";
@plugin "@tailwindcss/typography";
```
#### Basic Usage
```html
<article class="prose">
<h1>Article Title</h1>
<p>This content gets beautiful default styles...</p>
</article>
```
#### Size Modifiers
| Class | Description |
|-------|-------------|
| `prose-sm` | Smaller text (14px base) |
| `prose` | Default (16px base) |
| `prose-lg` | Larger text (18px base) |
| `prose-xl` | Extra large (20px base) |
| `prose-2xl` | Huge (24px base) |
```html
<article class="prose md:prose-lg lg:prose-xl">
<!-- Responsive sizing -->
</article>
```
#### Color Themes
```html
<article class="prose prose-slate">Gray theme</article>
<article class="prose prose-zinc">Zinc theme</article>
<article class="prose prose-neutral">Neutral theme</article>
<article class="prose prose-stone">Stone theme</article>
```
#### Dark Mode
```html
<article class="prose dark:prose-invert">
<!-- Automatically inverts for dark mode -->
</article>
```
#### Element Modifiers
Override specific elements:
```html
<article class="
prose
prose-headings:text-blue-600
prose-a:text-blue-500
prose-a:no-underline
prose-code:text-pink-500
prose-img:rounded-lg
prose-strong:text-gray-900
prose-blockquote:border-blue-500
">
Content
</article>
```
#### Max Width Control
```html
<!-- Remove max-width constraint -->
<article class="prose max-w-none">
Full width content
</article>
```
#### Escaping Prose Styles
```html
<article class="prose">
<h1>Styled heading</h1>
<p>Styled paragraph</p>
<div class="not-prose">
<!-- This div and its children escape prose styles -->
<CustomComponent />
</div>
<p>Back to prose styles</p>
</article>
```
#### Custom Class Name
```css
@plugin "@tailwindcss/typography" {
className: wysiwyg;
}
```
```html
<article class="wysiwyg">Content</article>
```
### @tailwindcss/forms
Resets form elements to a consistent, easily-styleable baseline.
#### Installation
```bash
npm install -D @tailwindcss/forms
```
```css
@import "tailwindcss";
@plugin "@tailwindcss/forms";
```
#### Styled Elements
The plugin applies styles to:
- `input[type='text']`
- `input[type='email']`
- `input[type='password']`
- `input[type='number']`
- `input[type='url']`
- `input[type='date']`
- `input[type='datetime-local']`
- `input[type='month']`
- `input[type='week']`
- `input[type='time']`
- `input[type='search']`
- `input[type='tel']`
- `input[type='checkbox']`
- `input[type='radio']`
- `select`
- `select[multiple]`
- `textarea`
#### Basic Usage
```html
<!-- Text input -->
<input type="email" class="rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500">
<!-- Select -->
<select class="rounded-lg border-gray-300">
<option>Option 1</option>
<option>Option 2</option>
</select>
<!-- Checkbox -->
<input type="checkbox" class="rounded text-blue-500 focus:ring-blue-500">
<!-- Radio -->
<input type="radio" class="text-blue-500 focus:ring-blue-500">
<!-- Textarea -->
<textarea class="rounded-lg border-gray-300" rows="4"></textarea>
```
#### Strategy: Class-Based
For opt-in styling (doesn't apply global resets):
```css
@plugin "@tailwindcss/forms" {
strategy: class;
}
```
```html
<!-- Explicitly opt-in to form styles -->
<input type="text" class="form-input rounded-lg">
<select class="form-select rounded-lg">
<textarea class="form-textarea rounded-lg">
<input type="checkbox" class="form-checkbox rounded">
<input type="radio" class="form-radio">
```
#### Form Classes Reference
| Class | Element |
|-------|---------|
| `form-input` | Text inputs |
| `form-textarea` | Textareas |
| `form-select` | Selects |
| `form-multiselect` | Multiple selects |
| `form-checkbox` | Checkboxes |
| `form-radio` | Radio buttons |
#### Styling Checkboxes/Radios
```html
<!-- Colored checkbox -->
<input type="checkbox" class="rounded text-pink-500">
<!-- Accent color (native) -->
<input type="checkbox" class="accent-purple-600">
<!-- Custom size -->
<input type="checkbox" class="h-6 w-6 rounded text-blue-500">
```
### @tailwindcss/container-queries
Style elements based on their container's size instead of the viewport.
#### Installation
```bash
npm install -D @tailwindcss/container-queries
```
```css
@import "tailwindcss";
@plugin "@tailwindcss/container-queries";
```
#### Basic Usage
```html
<!-- Define a container -->
<div class="@container">
<!-- Use container query breakpoints -->
<div class="flex flex-col @md:flex-row @lg:gap-8">
<div class="@sm:text-lg @md:text-xl">
Responsive to container, not viewport
</div>
</div>
</div>
```
#### Container Breakpoints
| Prefix | Width |
|--------|-------|
| `@xs` | 320px |
| `@sm` | 384px |
| `@md` | 448px |
| `@lg` | 512px |
| `@xl` | 576px |
| `@2xl` | 672px |
| `@3xl` | 768px |
| `@4xl` | 896px |
| `@5xl` | 1024px |
| `@6xl` | 1152px |
| `@7xl` | 1280px |
#### Named Containers
```html
<!-- Name the container -->
<div class="@container/sidebar">
<!-- Reference by name -->
<div class="@md/sidebar:flex">
Only flex when sidebar container is md
</div>
</div>
<div class="@container/main">
<div class="@lg/main:grid-cols-3">
Grid when main container is lg
</div>
</div>
```
#### Arbitrary Container Values
```html
<div class="@container">
<div class="@[400px]:flex @[600px]:grid">
Arbitrary breakpoint values
</div>
</div>
```
## Creating Custom Plugins (v4)
### CSS-Only Utilities
For simple utilities, use the `@utility` directive instead of a JavaScript plugin:
```css
/* In your CSS file */
@utility content-auto {
content-visibility: auto;
}
@utility text-balance {
text-wrap: balance;
}
@utility scrollbar-none {
scrollbar-width: none;
-ms-overflow-style: none;
}
@utility scrollbar-none::-webkit-scrollbar {
display: none;
}
```
### JavaScript Plugins
For complex plugins requiring JavaScript:
```javascript
// plugins/my-plugin.js
import plugin from 'tailwindcss/plugin'
export default plugin(function({ addUtilities, addComponents, matchUtilities, theme }) {
// Add static utilities
addUtilities({
'.content-auto': {
'content-visibility': 'auto',
},
'.text-balance': {
'text-wrap': 'balance',
},
})
// Add components
addComponents({
'.btn': {
padding: theme('spacing.2') + ' ' + theme('spacing.4'),
borderRadius: theme('borderRadius.lg'),
fontWeight: theme('fontWeight.medium'),
},
'.btn-primary': {
backgroundColor: theme('colors.blue.500'),
color: theme('colors.white'),
'&:hover': {
backgroundColor: theme('colors.blue.600'),
},
},
})
// Add dynamic utilities
matchUtilities(
{
'text-shadow': (value) => ({
textShadow: value,
}),
},
{ values: theme('textShadow') }
)
})
```
Load in CSS:
```css
@import "tailwindcss";
@plugin "./plugins/my-plugin.js";
```
### Plugin with Theme Extension
```javascript
// plugins/gradients.js
import plugin from 'tailwindcss/plugin'
export default plugin(
function({ matchUtilities, theme }) {
matchUtilities(
{
'text-gradient': (value) => ({
backgroundImage: value,
backgroundClip: 'text',
color: 'transparent',
}),
},
{ values: theme('textGradient') }
)
},
{
theme: {
textGradient: {
primary: 'linear-gradient(to right, #667eea, #764ba2)',
secondary: 'linear-gradient(to right, #f093fb, #f5576c)',
sunset: 'linear-gradient(to right, #fa709a, #fee140)',
},
},
}
)
```
### Adding Custom Variants
```javascript
// plugins/variants.js
import plugin from 'tailwindcss/plugin'
export default plugin(function({ addVariant }) {
// Peer states
addVariant('peer-checked', ':merge(.peer):checkedRelated in Web Dev
generating-lwc-components
IncludedLightning Web Components with PICKLES methodology and 165-point scoring. Use this skill when the user creates or edits LWC components, builds wire service patterns, or writes Jest tests for LWC. TRIGGER when: user creates/edits LWC components, touches lwc/**/*.js, .html, .css, .js-meta.xml files, or asks about wire service, SLDS, or Jest LWC tests. DO NOT TRIGGER when: Apex classes (use generating-apex), Aura components, or Visualforce.
tanstack-query
IncludedManage server state in React with TanStack Query v5. Set up queries with useQuery, mutations with useMutation, configure QueryClient caching strategies, implement optimistic updates, and handle infinite scroll with useInfiniteQuery. Use when: setting up data fetching in React projects, migrating from v4 to v5, or fixing object syntax required errors, query callbacks removed issues, cacheTime renamed to gcTime, isPending vs isLoading confusion, keepPreviousData removed problems.
document-processor-api
IncludedProcess documents with Nutrient DWS. Use when the user wants to generate PDFs from HTML or URLs, convert Office/images/PDFs, assemble or split packets, OCR scans, extract text/tables/key-value pairs, redact PII, watermark, sign, fill forms, optimize PDFs, or produce compliance outputs like PDF/A or PDF/UA. Triggers include convert to PDF, merge these PDFs, OCR this scan, extract tables, redact PII, sign this PDF, make this PDF/A, or linearize for web delivery.
nutrient-document-processing
IncludedProcess documents with Nutrient DWS. Use when the user wants to generate PDFs from HTML or URLs, convert Office/images/PDFs, assemble or split packets, OCR scans, extract text/tables/key-value pairs, redact PII, watermark, sign, fill forms, optimize PDFs, or produce compliance outputs like PDF/A or PDF/UA. Triggers include convert to PDF, merge these PDFs, OCR this scan, extract tables, redact PII, sign this PDF, make this PDF/A, or linearize for web delivery.
tanstack-query
IncludedManage server state in React with TanStack Query v5. Covers useMutationState, simplified optimistic updates, throwOnError, network mode (offline/PWA), and infiniteQueryOptions. Use when setting up data fetching, fixing v4→v5 migration errors (object syntax, gcTime, isPending, keepPreviousData), or debugging SSR/hydration issues with streaming server components.
accelint-nextjs-best-practices
IncludedNext.js performance optimization and best practices. Use when writing Next.js code (App Router or Pages Router); implementing Server Components, Server Actions, or API routes; optimizing RSC serialization, data fetching, or server-side rendering; reviewing Next.js code for performance issues; fixing authentication in Server Actions; or implementing Suspense boundaries, parallel data fetching, or request deduplication.