Index of every page on this site: llms.txt
All skills
hairyf avatar

/tailwindcss

@ffa1f90
by Hairyhairyf/skills26 stars
5
Run it yourself

Tailwind CSS utility-first CSS framework. Use when styling web applications with utility classes, building responsive designs, or customizing design systems with theme variables.

Use this Skill: https://skilld.dev/gh/hairyf/skills/tailwindcss

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencescore-variants.md

≈868 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Variants

Variants let you apply utility classes conditionally based on states, pseudo-classes, pseudo-elements, media queries, and more.

Overview

Add a variant prefix to any utility class to apply it conditionally:

<!-- Apply bg-sky-700 only on hover -->
<button class="bg-sky-500 hover:bg-sky-700">Save</button>

Variants can be stacked to target specific situations:

<!-- Dark mode, medium breakpoint, on hover -->
<button class="dark:md:hover:bg-fuchsia-600">Save</button>

Pseudo-Class Variants

Interactive States

<button class="bg-violet-500 hover:bg-violet-600 focus:outline-2 focus:outline-violet-500 active:bg-violet-700">
  Save changes
</button>

Common interactive variants:

  • hover: - :hover pseudo-class
  • focus: - :focus pseudo-class
  • active: - :active pseudo-class
  • focus-visible: - :focus-visible
  • focus-within: - :focus-within
  • visited: - :visited

Structural Variants

<ul>
  <li class="py-4 first:pt-0 last:pb-0">Item 1</li>
  <li class="py-4 first:pt-0 last:pb-0">Item 2</li>
  <li class="py-4 first:pt-0 last:pb-0">Item 3</li>
</ul>

Common structural variants:

  • first: - :first-child
  • last: - :last-child
  • odd: - :nth-child(odd)
  • even: - :nth-child(even)
  • only: - :only-child

Form States

<input class="border-gray-300 required:border-red-500 invalid:border-red-500" />

Common form variants:

  • required: - :required
  • optional: - :optional
  • invalid: - :invalid
  • valid: - :valid
  • disabled: - :disabled
  • enabled: - :enabled
  • checked: - :checked

Pseudo-Element Variants

<input class="placeholder:text-gray-400 before:content-['*'] after:content-['required']" />

Common pseudo-element variants:

  • before: - ::before
  • after: - ::after
  • placeholder: - ::placeholder
  • selection: - ::selection
  • first-line: - ::first-line
  • first-letter: - ::first-letter

Media Query Variants

Responsive Variants

<div class="text-sm md:text-base lg:text-lg">Responsive text</div>

Dark Mode

<div class="bg-white dark:bg-gray-800 text-gray-900 dark:text-white">
  Content
</div>

By default uses prefers-color-scheme, but can be customized to use a class or data attribute.

Reduced Motion

<div class="transition-all motion-reduce:transition-none">
  Animated content
</div>

Attribute Selector Variants

<!-- RTL support -->
<div class="text-left rtl:text-right">Content</div>

<!-- Open state -->
<details class="[&[open]]:bg-gray-100">Details</details>

Arbitrary Variants

Use arbitrary variants for custom selectors:

<ul>
  <li class="lg:[&:nth-child(-n+3)]:hover:underline">Item</li>
</ul>

Child Selector Variants

<div class="[&>*]:mb-4 [&>*:last-child]:mb-0">
  <p>Paragraph 1</p>
  <p>Paragraph 2</p>
</div>

Key Points

  • Variants prefix utilities to apply them conditionally
  • Variants can be stacked: dark:md:hover:bg-blue-600
  • Use variants for states, pseudo-classes, media queries, and more
  • Arbitrary variants enable custom selector patterns
  • Child selector variants target descendant elements
<!-- Source references: - https://tailwindcss.com/docs/hover-focus-and-other-states -->

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 warning2mo5 checks · Risk SAFE
  • Gen Agent Trust Hub2mo

    A comprehensive reference skill for Tailwind CSS v4, containing only documentation and no executable scripts. It provides standard installation guides using official packages and well-known CDN services.

  • Socket2mo

    No alerts

  • Snyk2mo

    Risk: LOW · No issues

  • Runlayer9mo

    45/45 files flagged

  • ZeroLeaks7mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at ffa1f90. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last month.

Steadyupdated 10 months ago
Other metadata
metadata
{
  "author": "Hairyf",
  "version": "2026.2.2",
  "source": "Generated from https://github.com/tailwindlabs/tailwindcss.com, scripts located at https://github.com/hairyf/skills"
}
  • tailwindcss
  • css
  • utility-first
  • responsive-design
  • styling
  • theme-variables
  • dark-mode
  • web-development

README badge

README badge for hairyf/skills

Tailwind CSS v4 is a utility-first framework for styling web applications by composing design directly in markup using utility classes. Use this skill when building responsive designs, customizing theme variables with CSS-first configuration, or styling components with flexbox, grid, transforms, and effects utilities.

Generated from the current SKILL.md.

Does this skill cover Tailwind CSS v4?
Yes. The skill is based on Tailwind CSS v4.1.18, including v4's CSS-first configuration with theme variables and the @theme directive.
What setup methods does this skill document?
The skill covers Vite, PostCSS, CLI, and CDN installation paths. See the core-installation reference.
Does this skill include dark mode guidance?
Yes. The skill documents dark mode implementation using the dark variant and custom strategies.
Does this skill help migrate from Tailwind v3 to v4?
Yes. The features-upgrade reference covers breaking changes and rename mappings for upgrading from v3 to v4.
What topics does this skill not cover?
The skill focuses on core Tailwind utilities and configuration. It does not cover third-party plugins or integration with specific JavaScript frameworks beyond general markup styling.

Generated from the current SKILL.md. These answers refresh after source changes.