home / skills / yuniorglez / gemini-elite-core / tailwind4-expert

tailwind4-expert skill

/skills/tailwind4-expert

This skill guides Tailwind CSS 4.0+ CSS-first design, enabling token-based themes, native container queries, and zero-JS configuration for faster workflows.

npx playbooks add skill yuniorglez/gemini-elite-core --skill tailwind4-expert

Review the files below or copy the command above to add this skill to your agents.

Files (5)
SKILL.md
4.2 KB
---
name: tailwind4-expert
id: tailwind4-expert
version: 1.2.0
description: "Senior expert in Tailwind CSS 4.0+, CSS-First architecture, and modern Design Systems. Use when configuring themes, migrating from v3, or implementing native container queries."
---

# 🎨 Skill: tailwind4-expert

## Description
Senior specialist in Tailwind CSS 4.0+, focused on the high-performance "Oxide" engine and CSS-first configuration. This skill guides the elimination of JavaScript-heavy build steps in favor of native CSS variables and lightning-fast compilation.

## Core Priorities
1.  **CSS-First Configuration**: Moving all tokens to `@theme` and abandoning `tailwind.config.js`.
2.  **Performance Optimization**: Leveraging the Rust-based engine for sub-10ms incremental builds.
3.  **Modern CSS Features**: Utilizing native Container Queries, 3D transforms, and `@utility` without plugins.
4.  **Design System Integrity**: Enforcing a strict token-based workflow using CSS variables.

## 🚀 Top 5 Gains in Tailwind 4.0

1.  **Zero-JS Config**: The configuration *is* the CSS. No more context-switching between JS and CSS files.
2.  **Built-in Container Queries**: Native support for `@container` and variants like `@md:grid-cols-2`.
3.  **Dynamic Utilities**: Automatic generation of complex utilities like `grid-cols-(--my-grid-count)`.
4.  **Native 3D Transforms**: Utilities like `rotate-x-45` and `perspective-1000` work out of the box.
5.  **Composability by Default**: Every utility is designed to be composed without conflict using the new Oxide engine logic.

## 🛠️ Implementation Example: The Modern Layout (2026)

Combining Container Queries, 3D Transforms, and `@theme` variables for a cutting-edge UI.

```tsx
// 1. Define tokens in globals.css
// @theme { --color-neon: #00f0ff; --perspective-deep: 1200px; }

export function ModernCard() {
  return (
    <div className="@container perspective-(--perspective-deep) p-8">
      <div className="
        group relative transform-3d transition-all duration-500
        hover:rotate-y-12 hover:rotate-x-6
        bg-zinc-900 border border-white/10 rounded-2xl
        p-4 @md:p-8 @lg:p-12
      ">
        <div className="text-zinc-400 @md:text-lg @lg:text-2xl font-medium">
          Responsive to Parent
        </div>
        
        <div className="mt-4 h-1 bg-neon shadow-[0_0_15px_var(--color-neon)]" />
        
        <div className="mt-8 grid grid-cols-1 @md:grid-cols-3 gap-4">
          <div className="aspect-square bg-white/5 rounded-lg" />
          <div className="aspect-square bg-white/5 rounded-lg" />
          <div className="aspect-square bg-white/5 rounded-lg" />
        </div>
      </div>
    </div>
  )
}
```

## Table of Contents & Detailed Guides

### 1. [Migration from v3 to v4](./references/1-migration.md) — **CRITICAL**
- Automated upgrade tool (`npx @tailwindcss/upgrade`)
- Manual migration: Removing `tailwind.config.js`
- PostCSS vs. Lightning CSS integration

### 2. [The @theme Block & Design Systems](./references/2-design-system.md) — **CRITICAL**
- Defining colors, fonts, and spacing tokens
- Overriding vs. Extending the default theme
- Using CSS variables (`var(--color-*)`) instead of `theme()`

### 3. [Advanced Layout & Container Queries](./references/3-layout-and-containers.md) — **HIGH**
- Native Container Query variants (`@md:`, `@lg:`)
- Complex Grid configurations with dynamic variables
- 3D Transforms and Perspective

### 4. [Custom Utilities & @utility](./references/4-custom-utilities.md) — **MEDIUM**
- The new `@utility` directive syntax
- Handling functional/dynamic values in custom classes
- Avoiding arbitrary values with local theme variables

## Quick Reference: The "Do's" and "Don'ts"

| **Don't** | **Do** |
| :--- | :--- |
| `tailwind.config.js` | `@theme { ... }` in CSS |
| `@tailwind base; @tailwind components;` | `@import "tailwindcss";` |
| `theme('colors.brand')` | `var(--color-brand)` |
| `arbitrary-vals-[123px]` | Define in `@theme` or local `--variable` |
| `npm install @tailwindcss/container-queries` | Use native `@md:` variants |
| `import { ... } from 'tailwind-merge'` | Trust the Oxide engine for composition |

---
*Optimized for Tailwind CSS 4.0+ and Lightning CSS.*
*Updated: January 22, 2026 - 14:59*

Overview

This skill is a senior Tailwind CSS 4.0+ expert focused on CSS-first architecture, native engine performance, and modern Design System practices. I help teams migrate from v3, remove JavaScript-heavy config, and adopt Oxide-powered workflows for sub-10ms builds. The guidance centers on using @theme tokens, native container queries, and CSS variables to preserve design system integrity and runtime speed.

How this skill works

I inspect your project for legacy tailwind.config.js usage, PostCSS or Lightning CSS misconfigurations, and arbitrary-value patterns that break composability. I provide a migration plan to move tokens into @theme blocks, replace theme() lookups with var(--token) usage, and enable native @container and @md: variants. The output includes actionable code examples, utility recommendations, and performance checks to confirm Oxide engine behavior.

When to use it

  • Migrating an existing Tailwind v3 codebase to Tailwind 4.0+ with minimal runtime overhead.
  • Implementing a CSS-first design system where tokens live in CSS rather than JS config.
  • Optimizing build performance by switching to the Rust-based Oxide/Lightning engine.
  • Adopting native container queries, 3D transforms, and dynamic utilities without plugins.
  • Auditing utility composition problems and eliminating reliance on tailwind-merge or similar libs.

Best practices

  • Define colors, spacing, and typography in @theme blocks and reference them with CSS variables.
  • Avoid tailwind.config.js; treat CSS as the single source of truth for design tokens.
  • Use native @container and @md: variants instead of plugin-based solutions.
  • Prefer local --variables for dynamic utilities over arbitrary values in classnames.
  • Rely on Oxide’s composition logic; remove external merge utilities and JS-based runtime helpers.

Example use cases

  • Convert a site from tailwind.config.js tokens to @theme CSS blocks and verify token overrides.
  • Build a responsive card that adapts via container queries and uses perspective utilities for 3D effects.
  • Replace PostCSS setup with Lightning CSS for sub-10ms incremental builds in CI and dev.
  • Create composable, dynamic grid utilities using CSS variables like grid-cols-(--cols-count).
  • Enforce a token-only workflow across component libraries to prevent drift in large teams.

FAQ

Will removing tailwind.config.js break existing utilities?

No—when tokens are migrated into @theme and classes map to native utilities, Oxide resolves utilities at compile time. You must update any theme() calls to use var(--token) and ensure your @theme block mirrors required values.

Do I still need plugins for container queries or 3D transforms?

No. Tailwind 4.0+ provides native container query variants and built-in 3D transform utilities via the Oxide engine, removing the need for external plugins.