Tailwind css v4

From joe-bell/cva · View interactive version

Tailwind css v4 is an AI agent skill from the GitHub repository joe-bell/cva. Reference for Tailwind CSS v4 syntax and the differences from v3.x. Use when configuring Tailwind (CSS-first @theme config, @import "tailwindcss"), using new v4 features (container queries, 3D transforms, gradients, composable variants, @utility/@custom-variant/@plugin), or migrating v3 patterns. Th

How to use this skill

Skill file

Tailwind CSS v4

Core Changes

```css

@import "tailwindcss";

@theme {

--font-display: "Satoshi", "sans-serif";

--breakpoint-3xl: 1920px;

--color-avocado-500: oklch(0.84 0.18 117.33);

--ease-fluid: cubic-bezier(0.3, 0, 0, 1);

}

```

```css

@import "tailwindcss";

@config "../../tailwind.config.js";

```

Theme Configuration

New Features

New Variants

Custom Extensions

```css

@utility tab-4 {

tab-size: 4;

}

```

```css

@custom-variant wide-gamut {

@media (color-gamut: p3) {

@slot;

}

}

@custom-variant theme-midnight (&:where([data-theme="midnight"] *));

```

```css

@plugin "@tailwindcss/typography";

```

Breaking Changes

Advanced Configuration

```css

@import "tailwindcss" prefix(tw);

```

```css

@import "tailwindcss";

@config "../../tailwind.config.js";

```

```css

@import "tailwindcss";

@custom-variant dark (&:where(.dark, .dark *));

```

```css

@utility container {

margin-inline: auto;

padding-inline: 2rem;

}

```

```html

<style>

@reference "../../my-theme.css";

/* or, when using only the default theme */

@reference "tailwindcss";

h1 {

@apply text-2xl font-bold text-red-500;

}

</style>

```

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.