/tailwindcss-master:tailwindcss-debuggingfrom tailwindcss-master
Diagnoses and resolves common Tailwind CSS issues: classes not applying, JIT mode missing dynamic classes, v3-to-v4 migration errors, PostCSS config problems, IntelliSense issues, production build missing classes, and specificity conflicts.
Ships in tailwindcss-master. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
v4 automatically detects content, but if styles are missing:
/* Explicitly specify sources */
@import "tailwindcss";
@source "./src/**/*.{html,js,jsx,ts,tsx,vue,svelte}";
<!-- WRONG - Dynamic class won't be detected -->
<div class={`text-${color}-500`}>
<!-- CORRECT - Use complete class names -->
<div class={color === 'blue' ? 'text-blue-500' : 'text-red-500'}>
# Restart dev server
npm run dev
# Clear cache and rebuild
rm -rf node_modules/.vite
npm run build
// OLD (v3)
export default {
plugins: {
tailwindcss: {},
autoprefixer: {}
}
}
// NEW (v4)
export default {
plugins: {
'@tailwindcss/postcss': {}
}
}
/* v4 - Configure in CSS, not JS */
@import "tailwindcss";
@theme {
--color-primary: oklch(0.6 0.2 250);
}
/* v4 - Add if using selector strategy */
@custom-variant dark (&:where(.dark, .dark *));
/* Browser DevTools: Inspect element → Styles panel */
/* Look for crossed-out styles */
<!-- Use !important (last resort) -->
<div class="!mt-0">
<!-- Or increase specificity with variants -->
<div class="[&]:mt-0">
/* Your custom CSS should come after Tailwind */
@import "tailwindcss";
@import "./custom.css"; /* After Tailwind */
/* Ensure plugin is loaded */
@plugin "@tailwindcss/typography";
<!-- Use element modifiers -->
<article class="prose prose-h1:text-4xl prose-a:text-blue-600">
<!-- Or escape prose entirely -->
<article class="prose">
<div class="not-prose">
<CustomComponent />
</div>
</article>
<!-- Forms plugin only styles inputs with type attribute -->
<input type="text" /> <!-- ✓ Styled -->
<input /> <!-- ✗ Not styled -->
@plugin "@tailwindcss/forms" {
strategy: class;
}
<!-- Now explicitly opt-in -->
<input type="text" class="form-input" />
# Install Tailwind CSS IntelliSense
code --install-extension bradlc.vscode-tailwindcss
Features:
npm install -D @tailwindcss/debug-screens
@plugin "@tailwindcss/debug-screens";
<!-- Shows current breakpoint in corner -->
<body class="debug-screens">
# Output CSS to file for inspection
npx tailwindcss -o output.css --content './src/**/*.{html,js}'
# With verbose logging
DEBUG=tailwindcss:* npm run build
# Look for plugin-related errors
npm run build 2>&1 | grep -i plugin
/* In browser DevTools, check :root for variables */
:root {
--color-blue-500: oklch(...);
--spacing-4: 1rem;
}
/* Add explicit sources if auto-detection fails */
@source "./src/**/*.tsx";
@source "./components/**/*.tsx";
/* Exclude paths */
@source not "./src/generated/**";
npm install -D @tailwindcss/postcss
Using v3 tooling with v4 syntax. Update your build setup:
npm install -D tailwindcss@latest @tailwindcss/postcss@latest
Dynamic class generation issue:
// BAD
const classes = `bg-${dynamic}-500`
// GOOD
const colorMap = {
primary: 'bg-blue-500',
danger: 'bg-red-500'
}
const classes = colorMap[dynamic]
# Restart dev server
npm run dev
# Clear Vite cache
rm -rf node_modules/.vite
# Clear Next.js cache
rm -rf .next
# Check CSS file size
ls -lh dist/assets/*.css
# If too large, check for:
# 1. Dynamic class generation
# 2. Unnecessary safelisting
# 3. Unused plugins
# Time the build
time npm run build
# v4 should be very fast
# Full build: <1s
# Incremental: microseconds
@import "tailwindcss";@tailwindcss/postcss (not tailwindcss)@tailwindcss/vite (if using Vite)# Create fresh project
npm create vite@latest repro -- --template react-ts
cd repro
npm install -D tailwindcss @tailwindcss/vite
# Add minimal code that shows the issue
# Share on GitHub Issues or Discord
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
12 skills in this plugin
/tailwindcss-accessibilityTailwind CSS accessibility patterns including WCAG 2.2 compliance, touch targets, focus management, and ARIA.
PROACTIVELY activate for: (1) building accessible UI with Tailwind, (2) WCAG 2.2 compliance (Level A, AA, AAA), (3) focus rings and focus-visible styling, (4) minimum touch-target sizes (24x24/44x44), (5) color contrast and text legibility, (6) screen-reader-only utilities (sr-only, not-sr-only), (7) prefers-reduced-motion handling, (8) ARIA attribute styling (data-state, aria-* selectors), (9) keyboard navigation patterns, (10) accessible forms (label association, error announcements).
Provides: WCAG 2.2 checklist, focus-management utilities, touch-target sizing recipes, sr-only patterns, and accessible component templates.
/tailwindcss-advanced-componentsTailwind CSS advanced component patterns with CVA (class-variance-authority) and variant management.
PROACTIVELY activate for: (1) building reusable component variants with CVA, (2) compound variants for complex states, (3) tailwind-merge for safe class composition, (4) clsx/cn utility for conditional classes, (5) Headless UI / Radix UI primitives styled with Tailwind, (6) shadcn/ui patterns, (7) component slot patterns (asChild), (8) polymorphic components, (9) prop-driven design tokens.
Provides: CVA setup recipes, cn utility implementation, compound-variant patterns, shadcn/ui-style component templates, and asChild slot examples.
npx claudepluginhub josiahsiegel/claude-plugin-marketplace --plugin tailwindcss-masterOther plugins' skills for the same job