This gets you up to speed on Tailwind v4's CSS-first config approach using @theme directives instead of tailwind.config.js files. You'll want this when migrating from v3 or starting fresh with the new @tailwindcss/vite plugin. The big shift is defining design tokens directly in CSS with OKLCH colors and understanding the three @theme modes: default for CSS variables, inline for direct value substitution, and reference for fallbacks. Honestly, the inline mode is a nice performance win for static values, but the real win is just keeping your theme config in the same file as your styles. Includes concrete examples for two-tier variable systems, custom fonts, and animation keyframes.

skills.sh installs
817
GitHub stars
87
last updated
Aug 21, 2026

Install

$ npx -y skills add existential-birds/beagle --skill tailwind-v4 --agent claude-code

Installs into .claude/skills of the current project.

Files

Tailwind CSS v4 Best Practices

Quick Reference

Vite Plugin Setup:

// vite.config.ts
import tailwindcss from '@tailwindcss/vite';
import { defineConfig } from 'vite';

export default defineConfig({
  plugins: [tailwindcss()],
});

CSS Entry Point:

/* src/index.css */
@import 'tailwindcss';

@theme Inline Directive:

@theme inline {
  --color-primary: oklch(60% 0.24 262);
  --color-surface: oklch(98% 0.002 247);
}

Key Differences from v3

Featurev3v4
Configurationtailwind.config.js@theme in CSS
Build ToolPostCSS plugin@tailwindcss/vite
Colorsrgb() / hsl()oklch() (default)
Theme Extensionextend: {} in JSCSS variables
Dark ModedarkMode config optionCSS variants

@theme Directive Modes

default (standard mode)

Generates CSS variables that can be referenced elsewhere:

@theme {
  --color-brand: oklch(60% 0.24 262);
}

/* Generates: :root { --color-brand: oklch(...); } */
/* Usage: text-brand → color: var(--color-brand) */

Sponsors

Details

Repository
github.com/existential-birds/beagle
Categories
Frontend Development, Design & UI/UX
First seen
Apr 16, 2026

More from existential-birds/beagle

All 40
1pproenca avatarreact-refactorpproenca/dot-skillsArchitectural refactoring guide for React applications covering component architecture, state architecture, hook patterns, component decomposition, coupling and791skills.sh installs
2ovachiever avatarreact-hook-form-zodovachiever/droid-tingsBuild type-safe validated forms in React using React Hook Form and Zod schema validation. Single schema works on both client and server for DRY validation with 724skills.sh installs
3getsentry avatarsentry-nextjs-sdkgetsentry/sentry-agent-skillsFull Sentry SDK setup for Next.js. Use when asked to "add Sentry to Next.js", "install @sentry/nextjs", or configure error monitoring, tracing, session replay, 665skills.sh installs
4pluginagentmarketplace avatarreact-native-animationspluginagentmarketplace/custom-plugin-react-nativeMaster animations - Reanimated 3, Gesture Handler, layout animations, and performance optimization663skills.sh installs
5davila7 avatarnextjs-best-practicesdavila7/claude-code-templatesNext.js App Router principles. Server Components, data fetching, routing patterns.632skills.sh installs
6langgenius avatarvercel-react-best-practiceslanggenius/difyReact and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js c612skills.sh installs