/vibe:ghcopilot-instr-tailwind-v4-vitefrom vibe
Guides installation and configuration of Tailwind CSS v4+ with Vite, covering the new @tailwindcss/vite plugin, CSS-first configuration, and common pitfalls to avoid.
Ships in vibe. 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.
None: SKILL.md is the whole skill.
Instructions for installing and configuring Tailwind CSS version 4 and above using the official Vite plugin. Tailwind CSS v4 introduces a simplified setup that eliminates the need for PostCSS configuration and tailwind.config.js in most cases.
@theme directiveInstall tailwindcss and the @tailwindcss/vite plugin:
npm install tailwindcss @tailwindcss/vite
Add the @tailwindcss/vite plugin to your Vite configuration file:
// vite.config.ts
import { defineConfig } from 'vite'
import tailwindcss from '@tailwindcss/vite'
export default defineConfig({
plugins: [
tailwindcss(),
],
})
For React projects with Vite:
// vite.config.ts
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import tailwindcss from '@tailwindcss/vite'
export default defineConfig({
plugins: [
react(),
tailwindcss(),
],
})
Add the Tailwind CSS import to your main CSS file (e.g., src/index.css or src/App.css):
@import "tailwindcss";
Ensure your main CSS file is imported in your application entry point:
// src/main.tsx or src/main.ts
import './index.css'
Run the development server to verify installation:
npm run dev
Tailwind v4 uses CSS-first configuration. Do not create a tailwind.config.js file unless you have specific legacy requirements.
// ❌ NOT NEEDED in Tailwind v4
module.exports = {
content: ['./src/**/*.{js,ts,jsx,tsx}'],
theme: {
extend: {},
},
plugins: [],
}
When using the @tailwindcss/vite plugin, PostCSS configuration for Tailwind is not required.
// ❌ NOT NEEDED when using @tailwindcss/vite
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
The old @tailwind directives are replaced by a single import:
/* ❌ OLD - Do not use in Tailwind v4 */
@tailwind base;
@tailwind components;
@tailwind utilities;
/* ✅ NEW - Use this in Tailwind v4 */
@import "tailwindcss";
Use the @theme directive in your CSS to customize your design tokens:
@import "tailwindcss";
@theme {
--color-primary: #3b82f6;
--color-secondary: #64748b;
--font-sans: 'Inter', system-ui, sans-serif;
--radius-lg: 0.75rem;
}
Define custom utilities directly in CSS:
@import "tailwindcss";
@utility content-auto {
content-visibility: auto;
}
@utility scrollbar-hidden {
scrollbar-width: none;
&::-webkit-scrollbar {
display: none;
}
}
Define custom variants in CSS:
@import "tailwindcss";
@variant hocus (&:hover, &:focus);
@variant group-hocus (:merge(.group):hover &, :merge(.group):focus &);
After installation, verify:
tailwindcss and @tailwindcss/vite are in package.json dependenciesvite.config.ts includes the tailwindcss() plugin@import "tailwindcss";text-blue-500, p-4) render correctlyTest the installation with a simple component:
export function TestComponent() {
return (
<div className="min-h-screen bg-gray-100 flex items-center justify-center">
<h1 className="text-3xl font-bold text-blue-600 underline">
Hello, Tailwind CSS v4!
</h1>
</div>
)
}
@import "tailwindcss"; (not old directives)tailwindcss() pluginrm -rf node_modules/.vite && npm run devIf you see "Cannot find module '@tailwindcss/vite'":
npm install @tailwindcss/vite
If TypeScript cannot find types for the Vite plugin, ensure you have the correct import:
import tailwindcss from '@tailwindcss/vite'
If migrating from Tailwind v3:
tailwind.config.js (move customizations to CSS @theme)postcss.config.js (if only used for Tailwind)npm uninstall postcss autoprefixernpm install tailwindcss @tailwindcss/vite@tailwind directives with @import "tailwindcss";@tailwindcss/vite pluginWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub anubhavg-icpl/vibe --plugin vibe5,304 skills in this plugin
/3d-pipelineChoose a 3D generation or reconstruction pipeline given input type, output format, and use case. Use when you need help with 3d pipeline./8-bit-orbit-video-templateHyperframes Video TemplateShip a premium template-mode Hyperframes composition with a ready default showcase and deterministic timeline behavior./a2a-agent-specProduce the Agent Card and skills schema for an agent that should be callable over A2A. Use when you need help with a2a agent spec.Other plugins' skills for the same job