agentleFS
techbuzzztechbuzzz/awesome-opencode/skills/tailwind-ui/SKILL.md

tailwind-ui

Skill2 starsChanged 4 months agoMITView on GitHub

Use when building UI with Tailwind CSS: creating components, design systems, implementing dark mode, responsive layouts, animations; using CVA for variants; integrating shadcn/ui or Headless UI; optimizing Tailwind configuration.

2 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions2 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 2

    1. casoon/ai-agent-config★ 1same name
    2. bishal-pal/Tailwind-Repo★ 0same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository9 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 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.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before completing Tailwind UI work, verify:

    line 240

≈ “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 UI Expert Skill

You are an expert in Tailwind CSS and modern UI development, building accessible, beautiful interfaces.

When to Use

Activate this skill when the user:

  • Builds UI components with Tailwind CSS
  • Creates or extends a design system
  • Implements dark mode support
  • Designs responsive layouts (mobile-first)
  • Uses CVA (Class Variance Authority) for component variants
  • Integrates shadcn/ui, Radix UI, or Headless UI
  • Optimizes Tailwind configuration and bundle size
  • Implements accessible UI patterns

Core Tailwind Principles

Mobile-First Responsive Design

<!-- ✅ Mobile-first: base styles for mobile, then scale up -->
<div class="
  grid grid-cols-1 gap-4
  sm:grid-cols-2
  lg:grid-cols-3
  xl:grid-cols-4
">
  <!-- Cards -->
</div>

<!-- ✅ Text scaling -->
<h1 class="text-2xl font-bold sm:text-3xl lg:text-4xl xl:text-5xl">
  Heading
</h1>

Dark Mode

<!-- ✅ Use class-based dark mode -->
<div class="bg-white text-gray-900 dark:bg-gray-900 dark:text-gray-100">
  <p class="text-gray-600 dark:text-gray-400">Secondary text</p>
  <button class="bg-blue-600 hover:bg-blue-700 dark:bg-blue-500 dark:hover:bg-blue-600 text-white">
    Action
  </button>
</div>
// tailwind.config.js
module.exports = {
  darkMode: 'class',  // or 'media' for OS-based
  // ...
}

Tailwind v4 (CSS-first config)

/* tailwind.css — Tailwind v4 configuration */
@import "tailwindcss";

@theme {
  --color-brand: oklch(65% 0.25 250);
  --color-brand-hover: oklch(58% 0.25 250);
  --font-sans: "Inter Variable", sans-serif;
  --radius-button: 0.5rem;
}

Component Patterns

Reusable Button with CVA

import { cva, type VariantProps } from 'class-variance-authority';
import { cn } from '@/lib/utils';

const buttonVariants = cva(
  // Base styles
  'inline-flex items-center justify-center gap-2 rounded-md font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50',
  {
    variants: {
      variant: {
        default: 'bg-primary text-primary-foreground hover:bg-primary/90',
        destructive: 'bg-destructive text-destructive-foreground hover:bg-destructive/90',
        outline: 'border border-input bg-background hover:bg-accent hover:text-accent-foreground',
        ghost: 'hover:bg-accent hover:text-accent-foreground',
        link: 'text-primary underline-offset-4 hover:underline',
      },
      size: {
        sm: 'h-9 px-3 text-sm',
        md: 'h-10 px-4 py-2',
        lg: 'h-11 px-8 text-lg',
        icon: 'h-10 w-10',
      },
    },
    defaultVariants: {
      variant: 'default',
      size: 'md',
    },
  }
);

interface ButtonProps
  extends React.ButtonHTMLAttributes<HTMLButtonElement>,
    VariantProps<typeof buttonVariants> {}

export function Button({ className, variant, size, ...props }: ButtonProps) {
  return (
    <button
      className={cn(buttonVariants({ variant, size }), className)}
      {...props}
    />
  );
}

Card Component

// ✅ Composable card with subcomponents
export function Card({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {
  return (
    <div
      className={cn(
        'rounded-xl border bg-card text-card-foreground shadow-sm',
        className
      )}
      {...props}
    />
  );
}

export function CardHeader({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {
  return <div className={cn('flex flex-col space-y-1.5 p-6', className)} {...props} />;
}

export function CardTitle({ className, ...props }: React.HTMLAttributes<HTMLHeadingElement>) {
  return <h3 className={cn('text-2xl font-semibold leading-none tracking-tight', className)} {...props} />;
}

export function CardContent({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {
  return <div className={cn('p-6 pt-0', className)} {...props} />;
}

Layout Patterns

<!-- ✅ Sidebar + Content layout -->
<div class="flex h-screen overflow-hidden">
  <aside class="w-64 shrink-0 border-r bg-muted/40 overflow-y-auto">
    <!-- Sidebar -->
  </aside>
  <main class="flex-1 overflow-y-auto p-6">
    <!-- Content -->
  </main>
</div>

<!-- ✅ Sticky header + scrollable content -->
<div class="flex flex-col h-screen">
  <header class="sticky top-0 z-50 border-b bg-background/95 backdrop-blur">
    <!-- Header -->
  </header>
  <main class="flex-1 overflow-y-auto">
    <!-- Content -->
  </main>
</div>

Form Components

<!-- ✅ Accessible form field -->
<div class="grid gap-2">
  <label for="email" class="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70">
    Email
  </label>
  <input
    id="email"
    type="email"
    placeholder="name@example.com"
    class="flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50"
  />
  <p class="text-sm text-muted-foreground">We'll never share your email.</p>
</div>

Animation & Transitions

<!-- ✅ Smooth hover transitions -->
<button class="transform transition-all duration-200 hover:scale-105 active:scale-95">
  Click me
</button>

<!-- ✅ Fade in animation -->
<div class="animate-in fade-in slide-in-from-bottom-4 duration-500">
  Content
</div>

Tailwind Configuration Tips

// tailwind.config.js
module.exports = {
  content: ['./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}'],
  theme: {
    extend: {
      colors: {
        brand: { DEFAULT: '#6366f1', hover: '#4f46e5', light: '#e0e7ff' },
      },
      fontFamily: {
        sans: ['Inter Variable', 'Inter', ...defaultTheme.fontFamily.sans],
        mono: ['JetBrains Mono', ...defaultTheme.fontFamily.mono],
      },
      animation: {
        'fade-in': 'fadeIn 0.3s ease-out',
        'slide-up': 'slideUp 0.4s ease-out',
      },
      keyframes: {
        fadeIn: { from: { opacity: '0' }, to: { opacity: '1' } },
        slideUp: { from: { transform: 'translateY(10px)', opacity: '0' }, to: { transform: 'none', opacity: '1' } },
      },
    },
  },
  plugins: [require('@tailwindcss/typography'), require('@tailwindcss/forms')],
};

Quality Checklist

Before completing Tailwind UI work, verify:

  • Mobile-first responsive design (test at sm/md/lg/xl breakpoints)
  • Dark mode works correctly
  • All interactive elements have focus-visible styles
  • Color contrast meets WCAG AA (4.5:1 for text)
  • No hardcoded colors — use design tokens/CSS vars
  • Animations respect prefers-reduced-motion
  • Forms have proper labels (not just placeholders)
  • No unused custom CSS that duplicates Tailwind utilities

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.