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

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

Preflight

Preflight is Tailwind's opinionated set of base styles that smooth over cross-browser inconsistencies.

Overview

Built on top of modern-normalize, Preflight is automatically injected when you import tailwindcss:

@layer theme, base, components, utilities;

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

Key Resets

Margins Removed

All default margins are removed from headings, paragraphs, blockquotes, etc:

*,
::after,
::before {
  margin: 0;
  padding: 0;
}

This prevents accidentally relying on browser default margins that aren't part of your spacing scale.

Border Styles Reset

Borders are reset to make adding borders easier:

*,
::after,
::before {
  box-sizing: border-box;
  border: 0 solid;
}

Since the border utility only sets border-width, this ensures adding border always creates a solid 1px border using currentColor.

Headings Unstyled

All headings are unstyled by default:

h1, h2, h3, h4, h5, h6 {
  font-size: inherit;
  font-weight: inherit;
}

Reasons:

  • Avoids deviating from your type scale
  • In UI development, headings should often be visually de-emphasized

Lists Unstyled

Ordered and unordered lists have no bullets or numbers:

ol, ul, menu {
  list-style: none;
}

Style lists using utilities:

<ul class="list-inside list-disc">
  <li>One</li>
  <li>Two</li>
</ul>

Accessibility: Add role="list" for screen readers when keeping lists unstyled:

<ul role="list">
  <li>One</li>
  <li>Two</li>
</ul>

Images Are Block-Level

Images and replaced elements are display: block:

img, svg, video, canvas, audio, iframe, embed, object {
  display: block;
  vertical-align: middle;
}

Use inline utility if needed:

<img class="inline" src="..." alt="..." />

Images Are Constrained

Images and videos are constrained to parent width:

img, video {
  max-width: 100%;
  height: auto;
}

Override with max-w-none:

<img class="max-w-none" src="..." alt="..." />

Hidden Attribute

Elements with hidden attribute stay hidden:

[hidden]:where(:not([hidden="until-found"])) {
  display: none !important;
}

Extending Preflight

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;
  }
}

Disabling Preflight

Import Tailwind components individually, omitting Preflight:

@layer theme, base, components, utilities;

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

Working Around Third-Party Libraries

Some libraries may conflict with Preflight. Override Preflight styles:

@layer base {
  .google-map * {
    border-style: none;
  }
}

Key Points

  • Preflight normalizes cross-browser inconsistencies
  • Margins, borders, headings, and lists are reset
  • Images are block-level and constrained by default
  • Extend Preflight with @layer base
  • Disable by omitting the preflight import
  • Override Preflight styles when needed for third-party libraries
<!-- Source references: - https://tailwindcss.com/docs/preflight -->

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.