
Tailwind V4
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-codeInstalls 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
| Feature | v3 | v4 |
|---|---|---|
| Configuration | tailwind.config.js | @theme in CSS |
| Build Tool | PostCSS plugin | @tailwindcss/vite |
| Colors | rgb() / hsl() | oklch() (default) |
| Theme Extension | extend: {} in JS | CSS variables |
| Dark Mode | darkMode config option | CSS 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- React Flow Advanced643
- React Router V7577
- React Flow Architecture536
- Vitest Testing471
- Docling431
- Fastapi Code Review387
- React Flow Implementation374
- Shadcn Ui356
- React Flow Code Review324
- Langgraph Architecture282
- Swiftui Code Review273
- Tutorial Docs271
- Bubbletea Code Review265
- Zustand State258
- Adr Writing250
- Dagre React Flow247
- Swift Code Review247
- Pytest Code Review232
- Sqlalchemy Code Review225
- Pydantic Ai Common Pitfalls221
- Pydantic Ai Agent Creation219
- Agent Architecture Analysis217
- Ai Elements209
- Go Code Review204