skillZs
★ LIVE SKILL TAGS ★
>>> LIVE SKILLS INDEX <<<
* OPEN SOURCE *
NO LOGIN, NO TRACKING
※ REAL INSTALL DATA ※
← back to all skills
tlq5l/tailwindcss-v4-skill51 installs

tailwindcss-v4

Tailwind CSS v4 patterns: CSS-first config, @theme/@utility/@variant directives, migration from v3. Use when working with Tailwind v4 projects.

How do I install this agent skill?

npx skills add https://github.com/tlq5l/tailwindcss-v4-skill --skill tailwindcss-v4
view source ↗

Is this agent skill safe to install?

  • Gen Agent Trust Hubpass

    This skill provides a high-quality knowledge base for migrating to and using Tailwind CSS v4. The repository is well-structured and contains legitimate technical documentation. No malicious obfuscation, data exfiltration, or prompt injection patterns were detected. It includes developer utility scripts for building and validating the skill, which utilize standard shell execution and package management for testing purposes.

  • Socketpass

    No alerts

  • Snykpass

    Risk: LOW · No issues

  • Runlayerwarn

    28/37 files flagged

What does this agent skill do?

Tailwind CSS v4 Skill

CSS-first configuration, new directives, migration from v3.

Quick Reference

v4 Entry Point

@import "tailwindcss";

NOT the v3 way:

/* ❌ These cause errors in v4 */
@tailwind base;
@tailwind components;
@tailwind utilities;

Key Directives

DirectivePurpose
@themeDefine design tokens (colors, spacing, fonts)
@utilityCreate custom utility classes
@variantDefine custom variants (hover, focus, etc.)
@sourceControl class detection and safelisting
@referenceImport for @apply without emitting CSS

Theme Configuration (CSS-first)

@import "tailwindcss";

@theme {
  --color-primary: #3b82f6;
  --color-secondary: #64748b;
  --font-display: "Inter", sans-serif;
  --spacing-18: 4.5rem;
}

NOT tailwind.config.js:

// ❌ v3 pattern - don't use in v4
module.exports = {
  theme: {
    extend: {
      colors: { primary: '#3b82f6' }
    }
  }
}

Custom Utilities

@utility content-auto {
  content-visibility: auto;
}

/* Functional utility must end in -* */
@utility tab-* {
  --tab-size: --value(--spacing-*, [integer]);
  tab-size: var(--tab-size);
}

Custom Variants

Use @custom-variant to define new variants (not @variant).

@custom-variant hocus (&:hover, &:focus);

/* Dark mode with class strategy */
@custom-variant dark (&:is(.dark *));

/* Body block with @slot */
@custom-variant hocus {
  &:hover, &:focus { @slot; }
}

Theme Configuration

@theme {
  --color-primary: #3b82f6;

  /* Clear namespace */
  --color-*: initial;
}

Theme Flags

  • default: Merge with default theme
  • inline: Emit variables to output
  • static: Use values but don't emit vars
  • reference: Use values but don't emit CSS
@theme inline {
  --font-sans: "SF Pro Text", system-ui;
}

New Gradient Syntax

<!-- v4 preferred - supports interpolation color space -->
<div class="bg-linear-to-r/oklch from-blue-500 to-purple-500"></div>

<!-- Also: bg-linear-to-b, bg-radial, bg-conic -->

New Variants

  • @min-[400px]: / @max-[600px]: (Container queries)
  • starting: (@starting-style)
  • details-content: (::details-content)
  • inverted-colors:, noscript:, print:

Safelisting Classes

/* Inline safelist */
@source inline("bg-red-500 text-white hidden");

/* From external source */
@source "../content/**/*.md";

Migration from v3

v3v4
@tailwind base/components/utilities@import "tailwindcss"
tailwind.config.js theme.extend@theme { --color-* }
PostCSS tailwindcss plugin@tailwindcss/postcss
@apply with config values@reference import first

PostCSS Setup

// postcss.config.js
export default {
  plugins: {
    '@tailwindcss/postcss': {}  // NOT 'tailwindcss'
  }
}

Vite Setup

// vite.config.ts
import tailwindcss from '@tailwindcss/vite'

export default {
  plugins: [tailwindcss()]
}

Sources: Tailwind v4 Docs, GitHub

Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.

<a href="https://skillzs.dev/skills/tlq5l/tailwindcss-v4-skill/tailwindcss-v4">View tailwindcss-v4 on skillZs</a>