configuring-tailwind-v4

Configure Tailwind CSS v4 with CSS-first @import and @theme directives.

Updated Nov 21, 2025
One-click install
npx skills add https://github.com/djankies/claude-configs --skill configuring-tailwind-v4
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: configuring-tailwind-v4
Source: https://github.com/djankies/claude-configs/tree/main/tailwind-4/skills/configuring-tailwind-v4
Command: npx skills add https://github.com/djankies/claude-configs --skill configuring-tailwind-v4

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill guides configuring Tailwind v4 using CSS-first directives like @import and @theme, enabling a modern setup with CSS-driven customization.

Core Features & Use Cases

  • CSS-First Config: Move configuration into CSS for tokens and themes.
  • Framework Integration: Examples for Vite, PostCSS, and CLI setups.
  • Migration Guidance: Translate v3 patterns to v4 CSS-first workflows.

Quick Start

Start with a minimal CSS import of tailwindcss, add a @theme block, and wire PostCSS or Vite as needed.

Frequently Asked Questions about configuring-tailwind-v4

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure Tailwind CSS v4 with a CSS-first approach?

CSS-first Tailwind v4 configuration moves your theme and tokens into CSS using @import and @theme directives instead of JavaScript config. Add @import "tailwindcss" to your CSS file, define a @theme block with your tokens, and wire it through PostCSS, Vite, or CLI tooling to generate your stylesheet.

Can I use Tailwind v4 CSS-first setup with Vite?

Yes. Tailwind v4 supports Vite integration through a Vite plugin that processes your CSS-first @import and @theme directives. The plugin handles automatic content detection and generates your utility classes without a separate JavaScript configuration file.

How do I migrate from Tailwind v3 to v4 CSS-first?

Migrating to v4 CSS-first means translating your v3 JavaScript theme config into @theme directives in CSS, moving token definitions into a @theme block, and updating your build setup to use the v4 Vite plugin or PostCSS plugin instead of the v3 configuration approach.

Does Tailwind v4 CSS-first work with PostCSS?

Yes. Tailwind v4 provides a PostCSS plugin that processes @import and @theme directives in your CSS, enabling CSS-first configuration in any project using PostCSS, including those not using Vite or a framework.

What's the fastest way to set up Tailwind v4 from scratch?

Start with a minimal CSS file containing @import "tailwindcss" and a basic @theme block for your tokens, then configure your build tool—Vite plugin, PostCSS plugin, or CLI—to process the CSS. This CSS-first approach eliminates separate config files and enables setup in minutes.

Can I use Tailwind v4 CSS-first for an existing project or only for new ones?

Tailwind v4 CSS-first works for both new projects and migrations. The Skill provides guidance for translating existing v3 setups into v4 CSS-first workflows, allowing you to adopt the new approach incrementally or fully across Vite, PostCSS, and CLI-based projects.