agentleFS
RevealUIStudioRevealUIStudio/revskills/skills/tailwind-v4/SKILL.md

tailwind-v4

Skill2 starsChanged 51 days agoMITView on GitHub

Tailwind CSS v4 patterns, CSS-first configuration, and v3 migration guide. Use when writing styles, configuring @theme variables, creating components with CVA, migrating from tailwind.config.js, or using container queries, dark mode, and new v4 utility syntax. Covers @import tailwindcss, custom properties, oklch colors, and clsx.

11 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use operational-enterprise-ai, product-proof-saas and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • boraoztuncSkill

    operational-enterprise-ai

    Create or redesign enterprise AI, automation, security, and operations product pages that explain system boundaries, approvals, auditability, exceptions, and rollback. Use for dark cinematic heroes, hairline grids, metric pauses, expandable solution rows, case-study evidence, security proof, and qualified demo or waitlist handoffs.

    Also in 3 projects that use this

  • boraoztuncSkill

    product-proof-saas

    Create or redesign SaaS and AI product landing pages where a real workflow, interface, or deterministic demo is the central proof. Use for pale atmospheric shells, product UI in the hero, prompt-to-output stories, audience tabs, compact feature modules, honest pricing comparisons, and FAQ handoffs.

    Also in 3 projects that use this

  • Dragoon0xSkill

    pricing-page

    Present pricing in ways that reduce friction and increase clarity. Handles tier naming, feature comparison, anchor pricing, and plan selection psychology. Use when designing pricing pages, plan selectors, or upgrade prompts.

    Also in 3 projects that use this

  • ParthJadhavSkill

    app-store-screenshots

    Use when building App Store or Google Play screenshot pages, generating exportable marketing screenshots for iOS, macOS, and/or Android apps, or scaffolding a screenshot editor with Next.js. Triggers on app store, mac app store, play store, screenshots, marketing assets, html-to-image, phone mockup, mac mockup, android screenshots, feature graphic.

    Also in 3 projects that use this

  • silvainfmSkill

    page-cro

    When the user wants to optimize, improve, or increase conversions on any marketing page — including homepage, landing pages, pricing pages, feature pages, or blog posts. Also use when the user says "CRO," "conversion rate optimization," "this page isn't converting," "improve conversions," or "why isn't this page working." For signup/registration flows, see signup-flow-cro. For post-signup activation, see onboarding-cro. For forms outside of signup, see form-cro. For popups/modals, see popup-cro.

    Also in 3 projects that use this

  • silvainfmSkill

    analytics-tracking

    When the user wants to set up, improve, or audit analytics tracking and measurement. Also use when the user mentions "set up tracking," "GA4," "Google Analytics," "conversion tracking," "event tracking," "UTM parameters," "tag manager," "GTM," "analytics implementation," or "tracking plan." For A/B test measurement, see ab-test-setup.

    Also in 3 projects that use this

  • +1 more from boraoztunc
  • +1 more from silvainfm

The file

We split this skill into the rules it gives an agent

9 rules. 0 are common, 2 are distinctive, and 7 are very specific to this project.

  • 0

    Common

    Most of the 9 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    All theme values become utilities automatically: bg-brand, font-heading, etc.

    line 33
  2. Very specific:

    Remove tailwind.config.js (or keep minimal for plugins)

    line 128
  3. Very specific:

    Update color opacity syntax: bg-blue-500/50 stays the same

    line 130
  4. Very specific:

    Don't create a tailwind.config.js in v4 — use @theme in CSS

    line 165
  5. Very specific:

    Don't use @apply excessively — prefer utility classes directly

    line 166
  6. Very specific:

    Don't hardcode colors — define in @theme for consistency

    line 167
  7. Distinctive:

    Don't use arbitrary values when a theme token exists

    line 168
  8. Very specific:

    Don't forget to set up clsx or cn() for conditional class merging

    line 169
  9. Distinctive:

    Don't list broad prefix aliases before specific subpath aliases in Vite config

    line 170

“Common” is measured: kept by at least 6 in 10 of the 9 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Tailwind CSS v4 Patterns

CSS-First Configuration (No tailwind.config.js)

Tailwind v4 uses CSS instead of JavaScript for configuration:

/* app.css */
@import "tailwindcss";

@theme {
  --color-brand: #3b82f6;
  --color-brand-dark: #1d4ed8;
  --font-heading: "Inter", sans-serif;
  --breakpoint-3xl: 1920px;
  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
  • No tailwind.config.js or tailwind.config.ts needed
  • @theme block defines design tokens as CSS custom properties
  • All theme values become utilities automatically: bg-brand, font-heading, etc.

Theme Variables

@theme {
  /* Colors */
  --color-primary: oklch(0.7 0.15 250);
  --color-surface: #ffffff;
  --color-surface-dark: #1a1a2e;

  /* Spacing */
  --spacing-gutter: 1.5rem;

  /* Typography */
  --font-sans: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", monospace;
  --text-display: 3.5rem;
  --leading-display: 1.1;

  /* Shadows */
  --shadow-card: 0 1px 3px oklch(0 0 0 / 0.12);

  /* Radius */
  --radius-card: 0.75rem;

  /* Animations */
  --animate-slide-in: slide-in 0.3s var(--ease-spring);
}

Using Theme Variables in Components

// Theme variables are available as utilities
<div className="bg-primary text-surface rounded-card shadow-card">
  <h1 className="font-sans text-display leading-display">Title</h1>
</div>
/* Or use CSS custom properties directly */
.custom-element {
  background: var(--color-primary);
  border-radius: var(--radius-card);
}

Dark Mode

@theme {
  --color-surface: #ffffff;
  --color-text: #1a1a2e;
}

/* Override in dark mode */
@media (prefers-color-scheme: dark) {
  :root {
    --color-surface: #1a1a2e;
    --color-text: #e5e5e5;
  }
}

Or use the dark: variant:

<div className="bg-surface dark:bg-surface-dark text-text dark:text-text-light">

New v4 Syntax

// Container queries (built-in)
<div className="@container">
  <div className="@lg:grid-cols-3">Content</div>
</div>

// Arbitrary theme values
<div className="bg-(--color-brand/50)">50% opacity brand</div>

// Nested groups
<div className="group/card">
  <div className="group-hover/card:opacity-100">Shows on card hover</div>
</div>

// has() variant
<div className="has-[input:checked]:bg-blue-500">

Migration from v3

Key changes:

  1. Move tailwind.config.js colors/fonts/etc. into @theme CSS block
  2. Remove tailwind.config.js (or keep minimal for plugins)
  3. Replace @tailwind base/components/utilities with @import "tailwindcss"
  4. Update color opacity syntax: bg-blue-500/50 stays the same
  5. Custom properties: theme() function replaced by var(--color-*) in CSS

Component Patterns (CVA)

import { cva, type VariantProps } from 'class-variance-authority';

const button = cva(
  'inline-flex items-center justify-center rounded-md font-medium transition-colors',
  {
    variants: {
      intent: {
        primary: 'bg-primary text-white hover:bg-primary-dark',
        secondary: 'bg-surface border border-gray-300 hover:bg-gray-50',
        danger: 'bg-red-600 text-white hover:bg-red-700',
      },
      size: {
        sm: 'h-8 px-3 text-sm',
        md: 'h-10 px-4 text-sm',
        lg: 'h-12 px-6 text-base',
      },
    },
    defaultVariants: {
      intent: 'primary',
      size: 'md',
    },
  }
);

type ButtonProps = VariantProps<typeof button> & React.ButtonHTMLAttributes<HTMLButtonElement>;

Common Mistakes to Avoid

  1. Don't create a tailwind.config.js in v4 — use @theme in CSS
  2. Don't use @apply excessively — prefer utility classes directly
  3. Don't hardcode colors — define in @theme for consistency
  4. Don't use arbitrary values when a theme token exists
  5. Don't forget to set up clsx or cn() for conditional class merging
  6. Don't list broad prefix aliases before specific subpath aliases in Vite config

Skill by RevealUI Studio — the agentic business runtime.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.