New advertisers: 50% off your first month with code FIRSTMONTHSee slots

Tailwind CSS v4 setup and theming with CSS-first @theme tokens, OKLCH colors, and dark mode.

skills.sh installs
824
GitHub stars
89
last updated
Aug 21, 2026
View on GitHub

What it does

  • Covers Vite plugin setup, CSS entry wiring, and migrating away from v3 tailwind.config.js to CSS-based theme configuration
  • Explains the @theme, @theme inline, and @theme reference modes, with tradeoffs for performance and DevTools debugging
  • Includes OKLCH color format guidance, CSS variable naming conventions, and a two-tier semantic token pattern for design systems
  • Enforces setup gates first: Vite wiring, major-version-4 dependencies, and theme tokens living in CSS rather than v3 config files

Install

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

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

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) */

Details

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

More from existential-birds/beagle

All 37

Similar to Tailwind V4

More Frontend & UI Code