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.

referencesfeatures-custom-styles.md

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

Adding Custom Styles

Tailwind is designed to be extensible. This guide covers customizing your theme, using arbitrary values, adding custom CSS, and extending the framework.

Customizing Your Theme

Add custom design tokens using @theme:

@import "tailwindcss";

@theme {
  --font-display: "Satoshi", "sans-serif";
  --breakpoint-3xl: 120rem;
  --color-brand-500: oklch(0.65 0.2 250);
  --ease-fluid: cubic-bezier(0.3, 0, 0, 1);
}

Arbitrary Values

Use square bracket notation for one-off values that don't belong in your theme:

<!-- Arbitrary values -->
<div class="top-[117px] bg-[#bada55] text-[22px]">
  Content
</div>

<!-- With variants -->
<div class="top-[117px] lg:top-[344px]">
  Content
</div>

CSS Variables as Arbitrary Values

Reference CSS variables:

<div class="fill-(--my-brand-color)">
  Content
</div>

This is shorthand for fill-[var(--my-brand-color)].

Arbitrary Properties

Use square brackets for CSS properties Tailwind doesn't have utilities for:

<div class="[mask-type:luminance]">
  Content
</div>

<!-- With variants -->
<div class="[mask-type:luminance] hover:[mask-type:alpha]">
  Content
</div>

CSS Variables

Set CSS variables with arbitrary properties:

<div class="[--scroll-offset:56px] lg:[--scroll-offset:44px]">
  Content
</div>

Arbitrary Variants

Create custom selectors on the fly:

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

Handling Whitespace

Use underscores for spaces in arbitrary values:

<div class="grid-cols-[1fr_500px_2fr]">
  Content
</div>

Tailwind converts underscores to spaces, except in contexts where underscores are valid (like URLs).

Custom Utilities

Add custom utilities with @utility:

@import "tailwindcss";

@utility tab-4 {
  tab-size: 4;
}

Now you can use tab-4 utility class, and it works with variants:

<div class="tab-4 hover:tab-8">
  Content
</div>

Custom Variants

Add custom variants with @custom-variant:

@import "tailwindcss";

@custom-variant theme-midnight (&:where([data-theme="midnight"] *));

Now you can use theme-midnight: variant:

<div class="theme-midnight:bg-black theme-midnight:text-white">
  Content
</div>

Using Variants in CSS

Apply Tailwind variants to custom CSS with @variant:

.my-element {
  background: white;
  
  @variant dark {
    background: black;
  }
  
  @variant hover {
    background: gray;
  }
}

Base Styles

Add base styles to the base layer:

@layer base {
  h1 {
    font-size: var(--text-2xl);
    font-weight: 600;
  }
  
  h2 {
    font-size: var(--text-xl);
    font-weight: 600;
  }
  
  a {
    color: var(--color-blue-600);
    text-decoration-line: underline;
  }
}

Component Styles

Add component styles to the components layer:

@layer components {
  .btn-primary {
    @apply bg-blue-500 hover:bg-blue-600 text-white font-semibold py-2 px-4 rounded;
  }
}

Key Points

  • Use @theme to customize design tokens
  • Arbitrary values with [] for one-off values
  • Arbitrary properties for CSS properties without utilities
  • @utility for custom utilities
  • @custom-variant for custom variants
  • @layer for organizing base and component styles
<!-- Source references: - https://tailwindcss.com/docs/adding-custom-styles -->

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.