agentleFS
michelvemichelve/hugin-cowork/skills/tailwindcss/SKILL.md

tailwindcss

Skill1 starsChanged 9 months agoMITView on GitHub

This skill should be used when the user is styling with Tailwind, adding utility classes, configuring Tailwind, setting up dark mode, or customizing the theme. It covers Tailwind CSS v4 utility-first styling patterns including responsive design, dark mode, and custom configuration.

  • Installs packages

12 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use app-renderer-systems, refactoring-analysis and 5 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.
  • pedronauckSkill

    app-renderer-systems

    Create, extend, or debug frontend domain modules organized under systems/. Covers adapters, Query hooks, local state, and public exports; excludes generic components and backend implementation.

    Also in 3 projects that use this

  • pedronauckSkill

    refactoring-analysis

    Audit code quality and architectural health or plan refactoring using Fowler code smells and techniques; write prioritized findings to docs/_refacs/. Excludes formatting, performance, and security audits.

    Also in 3 projects that use this

  • barisariburnuSkill

    tanstack

    Expert assistance for TanStack Router, Query (v5), and Table (v8). Use when users need help with file-based routing, type-safe navigation, data loading, search params, queries, mutations, optimistic updates, infinite queries, table state management, or debugging TanStack libraries.

    Also in 3 projects that use this

  • rohitg00Skill

    typescript-advanced

    Advanced TypeScript patterns including generics, conditional types, mapped types, template literals, and type guards

    Also in 3 projects that use this

  • SentrySkill

    next-best-practices

    Next.js best practices - file conventions, RSC boundaries, data patterns, async APIs, metadata, error handling, route handlers, image/font optimization, bundling

    Also in 3 projects that use this

  • VercelSkill

    vercel-react-best-practices

    React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.

    Also in 3 projects that use this

  • +1 more from pedronauck

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 6 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 11 edited versions we read keep these.

  • 6

    Distinctive

    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:

    Utility-First: Use utility classes instead of custom CSS

    line 26
  2. Distinctive:

    Consistent Spacing: Use Tailwind's spacing scale

    line 29
  3. Distinctive:

    Responsive by Default: Always consider mobile-first design

    line 280
  4. Distinctive:

    Extract Components: Avoid repeating long class lists

    line 281
  5. Distinctive:

    Leverage @apply Sparingly: Prefer utility classes in JSX

    line 283
  6. Distinctive:

    Optimize Production: Ensure purge is configured correctly

    line 286

“Common” is measured: kept by at least 6 in 10 of the 11 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 Development Guidelines

When to Use

  • Styling components with Tailwind utilities
  • Adding responsive design breakpoints
  • Implementing dark mode
  • Configuring Tailwind v4 theme (@theme inline)
  • Using utility classes for layout, typography, colors
  • Creating custom CSS with @layer
  • Working with Tailwind-specific patterns (cn(), cva())

Best practices for using Tailwind CSS v4 utility classes effectively.

Note: This project uses Tailwind CSS v4 with CSS-first configuration. No tailwind.config.js file is used - theme is defined via @theme inline in src/client/index.css.

Core Principles

  1. Utility-First: Use utility classes instead of custom CSS
  2. Mobile-First: Design for mobile, then scale up with responsive modifiers
  3. Component Extraction: Extract repeated patterns into components
  4. Consistent Spacing: Use Tailwind's spacing scale
  5. Custom Configuration: Extend the default theme for brand consistency

Basic Utilities

See basic-utilities.md for layout (flexbox, grid, positioning), spacing, typography, and color utility patterns.


Responsive Design

Breakpoints

// Mobile-first responsive classes
<div className="w-full md:w-1/2 lg:w-1/3">
  {/* Full width on mobile, half on medium screens, third on large */}
</div>

<h1 className="text-2xl md:text-4xl lg:text-6xl">
  {/* Responsive text sizes */}
</h1>

<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4">
  {/* Responsive grid */}
</div>

Container

<div className="container mx-auto px-4">
  {/* Centered container with horizontal padding */}
</div>

<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
  {/* Responsive container padding */}
</div>

Component Patterns

See component-patterns.md for button, card, and form input styling examples.


State Variants

Hover, Focus, Active

<button className="bg-blue-500 hover:bg-blue-600 active:bg-blue-700 focus:ring-2 focus:ring-blue-500">
  Interactive Button
</button>

<a href="#" className="text-blue-600 hover:text-blue-800 hover:underline">
  Link
</a>

Group Hover

<div className="group">
    <img src="/image.jpg" className="transition-opacity group-hover:opacity-75" />
    <p className="group-hover:text-blue-600">Hover the container</p>
</div>

Disabled

<button className="disabled:cursor-not-allowed disabled:opacity-50" disabled>
    Disabled Button
</button>

Dark Mode

This project uses class-based dark mode configured in src/client/index.css:

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

Colors use oklch values via CSS variables:

:root {
    --background: oklch(1 0 0);
    --foreground: oklch(0.145 0 0);
}

.dark {
    --background: oklch(0.145 0 0);
    --foreground: oklch(0.985 0 0);
}
// Use semantic token classes (not raw colors)
<div className="bg-background text-foreground">
    <h1 className="text-foreground">Title</h1>
    <p className="text-muted-foreground">Description</p>
</div>

Custom Styles

Arbitrary Values

<div className="top-[117px]">           {/* Custom top value */}
<div className="bg-[#1da1f2]">          {/* Custom color */}
<div className="grid-cols-[200px_1fr]"> {/* Custom grid template */}

@apply Directive

/* components/button.css */
.btn-primary {
    @apply rounded-md bg-blue-600 px-4 py-2 font-medium text-white;
    @apply hover:bg-blue-700 focus:ring-2 focus:ring-blue-500 focus:outline-none;
    @apply disabled:cursor-not-allowed disabled:opacity-50;
}

Configuration

CSS-First Configuration (This Project)

This project uses Tailwind CSS v4 with CSS-first configuration - no tailwind.config.js. All theme config lives in src/client/index.css:

@import "tailwindcss";
@import "tw-animate-css";

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

@theme inline {
    --font-sans: "Inter", ui-sans-serif, system-ui, sans-serif;
    --color-background: var(--background);
    --color-foreground: var(--foreground);
    --color-primary: var(--primary);
    --color-primary-foreground: var(--primary-foreground);
    --color-muted: var(--muted);
    --color-muted-foreground: var(--muted-foreground);
    --color-destructive: var(--destructive);
    --color-border: var(--border);
    --color-input: var(--input);
    --color-ring: var(--ring);
    --radius-sm: calc(var(--radius) - 4px);
    --radius-md: calc(var(--radius) - 2px);
    --radius-lg: var(--radius);
    --radius-xl: calc(var(--radius) + 4px);
}

Colors are defined as oklch CSS variables:

:root {
    --radius: 0.625rem;
    --background: oklch(1 0 0);
    --foreground: oklch(0.145 0 0);
    --primary: oklch(0.205 0 0);
    --primary-foreground: oklch(0.985 0 0);
    /* ... */
}

The Vite plugin handles Tailwind integration:

// vite.config.ts
import tailwindcss from "@tailwindcss/vite";
// ...
plugins: [tailwindcss() /* ... */];

Plugins

Official Plugins

npm install @tailwindcss/forms
npm install @tailwindcss/typography
npm install @tailwindcss/aspect-ratio
npm install @tailwindcss/container-queries
// @tailwindcss/forms
<input type="text" className="form-input rounded-md" />

// @tailwindcss/typography
<article className="prose lg:prose-xl">
  <h1>Article Title</h1>
  <p>Content...</p>
</article>

Performance

Build Integration

This project uses the @tailwindcss/vite plugin for optimal build performance. Tailwind v4 automatically detects and scans all template files - no content configuration needed.

Build Performance

Tailwind v4 delivers 3.5x faster full builds (~100ms) compared to v3 using modern CSS features like @property and color-mix().

Common Patterns

Centered Content

<div className="flex min-h-screen items-center justify-center">
    <div>Centered content</div>
</div>

Sticky Header

<header className="sticky top-0 z-50 border-b bg-white">
    <nav>Navigation</nav>
</header>

Grid Layout

<div className="grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-3">
    {posts.map((post) => (
        <PostCard key={post.id} post={post} />
    ))}
</div>

Truncate Text

<p className="truncate">This text will be truncated with ellipsis if too long</p>
<p className="line-clamp-3">This text will show max 3 lines with ellipsis</p>

Best Practices

  1. Use Consistent Spacing: Stick to Tailwind's spacing scale
  2. Responsive by Default: Always consider mobile-first design
  3. Extract Components: Avoid repeating long class lists
  4. Use Theme Colors: Define custom colors in config, not arbitrary values
  5. Leverage @apply Sparingly: Prefer utility classes in JSX
  6. Enable Dark Mode: Plan for dark mode from the start
  7. Use Plugins: Leverage official plugins for common needs
  8. Optimize Production: Ensure purge is configured correctly

Additional Resources

For detailed information, see:

  • Utility Patterns
  • Component Library
  • Configuration Guide

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.