xiaohongshu
xiaohongshu
configuring-tailwind-v4
Configure Tailwind CSS v4 using Vite plugin, PostCSS, or CLI with CSS-first configuration via @import and @theme directives. Use when setting up new projects or migrating build tools.
Full skill instructions
Configure Tailwind CSS v4 using modern CSS-first configuration. Tailwind v4 eliminates JavaScript configuration files in favor of CSS-based setup using @import and @theme directives.
Step 1: Install Dependencies
npm install tailwindcss @tailwindcss/vite
Step 2: Configure Vite Plugin
Add the Tailwind plugin to vite.config.js:
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import tailwindcss from '@tailwindcss/vite';
export default defineConfig({
plugins: [react(), tailwindcss()],
});
Step 3: Import Tailwind in CSS
Create or update your main CSS file (e.g., src/index.css):
@import 'tailwindcss';
Step 1: Install Dependencies
npm install tailwindcss @tailwindcss/postcss
Step 2: Configure PostCSS
Create postcss.config.js:
export default {
plugins: {
'@tailwindcss/postcss': {},
},
};
Step 3: Import Tailwind in CSS
@import 'tailwindcss';
Step 1: Install CLI
npm install tailwindcss @tailwindcss/cli
Step 2: Create Input CSS
@import 'tailwindcss';
Step 3: Run Build Command
npx @tailwindcss/cli -i input.css -o output.css --watch
Tailwind v4 uses the @theme directive for all customization:
@import 'tailwindcss';
@theme {
--font-display: 'Satoshi', 'sans-serif';
--font-body: 'Inter', 'sans-serif';
--color-brand-primary: oklch(0.65 0.25 270);
--color-brand-accent: oklch(0.75 0.22 320);
--breakpoint-3xl: 120rem;
--breakpoint-4xl: 160rem;
--spacing-18: 4.5rem;
--spacing-72: 18rem;
--radius-4xl: 2rem;
--shadow-brutal: 8px 8px 0 0 rgb(0 0 0);
}
Template files are discovered automatically using built-in heuristics. No content array configuration required. Files in .gitignore are automatically excluded.
Manual Source Control (when needed):
@import 'tailwindcss';
@source "../node_modules/@my-company/ui-lib";
@source "./legacy-components";
Exclude paths:
@source not "./legacy";
@source not "./docs";
Disable automatic detection:
@import 'tailwindcss' source(none);
@source "./src";
| v3 | v4 |
|---|---|
tailwind.config.js | CSS @theme directive |
@tailwind base; | @import 'tailwindcss'; |
content: [] array | Automatic detection |
postcss-tailwindcss | @tailwindcss/postcss |
Tailwind v4 requires:
Projects requiring older browser support must stay on v3.4.
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience