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-theme.md

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

Theme Variables

Theme variables are special CSS variables defined using the @theme directive that influence which utility classes exist in your project.

Overview

Theme variables store design tokens like colors, fonts, spacing, shadows, and breakpoints. They're defined using the @theme directive:

@import "tailwindcss";

@theme {
  --color-mint-500: oklch(0.72 0.11 178);
  --font-display: "Satoshi", "sans-serif";
  --breakpoint-3xl: 120rem;
}

Now utilities like bg-mint-500, font-display, and 3xl:grid-cols-6 become available.

Why @theme Instead of :root?

Theme variables aren't just CSS variables - they also instruct Tailwind to create new utility classes. Using @theme makes this explicit and ensures variables are defined top-level.

Use @theme for design tokens that map to utilities. Use :root for regular CSS variables that shouldn't have corresponding utilities.

Theme Variable Namespaces

Theme variables are organized into namespaces that map to utility classes:

Namespace Utility Classes
--color-* bg-red-500, text-sky-300, border-indigo-600, etc.
--font-* font-sans, font-serif, font-mono
--breakpoint-* Responsive variants like md:, lg:, xl:
--spacing-* Spacing scale for padding, margin, gap utilities
--shadow-* shadow-sm, shadow-md, shadow-lg
--ease-* Transition timing functions

Extending the Default Theme

Add new theme variables to extend the default theme:

@import "tailwindcss";

@theme {
  /* Add new color */
  --color-brand-500: oklch(0.65 0.2 250);
  
  /* Add new breakpoint */
  --breakpoint-3xl: 120rem;
  
  /* Add new font */
  --font-display: "Satoshi", "sans-serif";
}

Using Theme Variables

Tailwind generates CSS variables for your theme variables, so you can reference them:

<!-- Use utility classes -->
<div class="bg-brand-500 text-display">Content</div>

<!-- Reference CSS variables directly -->
<div style="background-color: var(--color-brand-500)">
  Content
</div>

Default Theme

When you import tailwindcss, it includes default theme variables:

@layer theme, base, components, utilities;

@import "./theme.css" layer(theme);
@import "./preflight.css" layer(base);
@import "./utilities.css" layer(utilities);

The default theme includes:

  • Color palette (red, blue, green, etc. with 50-950 shades)
  • Font families (sans, serif, mono)
  • Spacing scale
  • Shadows
  • Breakpoints (sm, md, lg, xl, 2xl)

Key Points

  • Theme variables define which utilities exist in your project
  • Use @theme directive to define design tokens
  • Variables must be defined top-level, not nested
  • Tailwind generates both utilities and CSS variables
  • Default theme provides a solid starting point
<!-- Source references: - https://tailwindcss.com/docs/theme -->

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.