agentleFS
bkjain655bkjain655/agent-skills/skills/tailwind-css-v4/SKILL.md

tailwind-css-v4

Skill0 starsChanged 3 months agoMITView on GitHub

Tailwind CSS v4 setup and patterns: @theme tokens, dark mode, responsive layouts, sr-only utilities, print styles, and prefers-reduced-motion. Use when styling React/Next.js apps with Tailwind v4 or migrating from v3 config.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

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

    Use in components: bg-brand-900, text-accent-400, font-sans.

    line 35
  2. Very specific:

    Use dark: variants: dark:bg-brand-900 dark:text-slate-100.

    line 61
  3. Distinctive:

    Always merge conditional classes:

    line 103

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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

Setup (Next.js)

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

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

PostCSS uses @tailwindcss/postcss — no separate tailwind.config.js required for tokens.

Theme tokens (@theme)

Define design system once:

@theme inline {
  --color-brand-50: #f0f4f8;
  --color-brand-900: #0a1929;
  --color-accent-400: #e6c35c;
  --font-sans: var(--font-dm-sans), system-ui, sans-serif;
}

Use in components: bg-brand-900, text-accent-400, font-sans.

CSS variables for runtime theming

:root {
  --background: #f8fafc;
  --foreground: #0a1929;
}
.dark {
  --background: #0a1929;
  --foreground: #f0f4f8;
  color-scheme: dark;
}

Map in @theme: --color-background: var(--background).

Dark mode

Pair with next-themes — class strategy on <html>:

<html suppressHydrationWarning>

Use dark: variants: dark:bg-brand-900 dark:text-slate-100.

Responsive patterns

Mobile-first breakpoints: sm:, md:, lg:.

<div className="flex flex-col gap-4 sm:flex-row lg:grid lg:grid-cols-3">

Common dashboard: stack on mobile, grid on lg:.

Accessibility utilities

<span className="sr-only">Loading</span>
<a className="sr-only focus:not-sr-only focus:fixed focus:z-[100] ...">Skip to main</a>

Reduced motion

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

Print styles

@media print {
  @page { size: A4 landscape; margin: 0.5cm; }
  .print\:hidden { /* use print:hidden in JSX */ }
}

cn() helper

Always merge conditional classes:

import { clsx } from "clsx";
import { twMerge } from "tailwind-merge";
export function cn(...inputs: ClassValue[]) {
  return twMerge(clsx(inputs));
}

Anti-patterns

  • Arbitrary hex in every component — use @theme tokens
  • !important everywhere — fix specificity with data attributes for export/print overrides
  • Inline style={{}} for static values Tailwind can express
  • Forgetting explicit height on chart/chart-like containers

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.