# Tailwind CSS — card for AI agents

Utility-first CSS framework for building custom user interfaces rapidly.

Category: Styling and CSS · npm package `tailwindcss` · latest version 4.3.3 (checked 2026-11-01)
Install: `npm install tailwindcss`
License: MIT (permissive)

In your own product (generator, app, hosted service): **yes**. Permissive license: ship it inside your own product, closed or open source, and keep its license and copyright notice.

## Rules for AI agents (paste into AGENTS.md or CLAUDE.md)

## Tailwind CSS
- Style elements by composing utility classes in the markup (`flex`, `pt-4`, `text-center`) instead of writing new CSS rules.
- For responsive styles, prefix a utility with a breakpoint (`sm:`, `md:`, `lg:`, `xl:`). For dark mode, put `dark:` in front of the color utility.
- When children should react to their parent's size, mark the parent `@container` and use variants like `@sm:grid-cols-2`.
- Put theme values (fonts, text sizes, colors) as CSS variables in an `@theme` block, e.g. `--font-sans` or `--color-mint-500`.
- Use `@source` rules to point Tailwind at files it should scan for classes.
- To respect reduced-motion preferences, the `motion-safe` variant can gate an animation; the team's Studio template uses it with Framer Motion's `useReducedMotion` to conditionally disable its navigation menu animation.
- If `@tailwindcss/cli --watch` misses file changes, run it with `--watch --poll[=ms]`.

## Agent Skills for it
- tailwindcss from MengTo/Skills: `npx skills add MengTo/Skills --skill tailwindcss`
- tailwind-css-patterns from midudev/autoskills: `npx skills add midudev/autoskills --skill tailwind-css-patterns`

## What it is
- Tailwind CSS is a utility-first CSS framework. You don't write a stylesheet for each component. You compose small classes such as `flex`, `pt-4`, `text-center` and `rotate-90` directly in HTML or JSX. The repository has been on GitHub since 2017 and is MIT-licensed. The README sends readers to tailwindcss.com for the full documentation.
- A prefix changes when a class applies. Examples are a breakpoint like `md:`, `dark:`, or a container size like `@sm:`. Theme values are CSS variables declared in an `@theme` block. Output is grouped into cascade layers. The production build drops unused CSS. The site shows version 4.3 and says the color palette "now uses more vibrant wide gamut colors".
- The v4.3.3 release notes name several ways to run it. There is a CLI (`@tailwindcss/cli`), a Vite plugin (`@tailwindcss/vite`) and a PostCSS plugin (`@tailwindcss/postcss`). There is also an in-browser build (`@tailwindcss/browser`) and the Tailwind Play playground. `@source` rules point it at the files to scan. A separate `@tailwindcss/upgrade` tool also exists.

## Caveats
- Shared styles mean repeated class strings: Headings that differ only by color carry the same classes three times. Samantha Ming writes that moving them into a CSS class "kind of defeats the purpose". She avoided it by making a Vue component for anything repeated.
- v4.3.3 fixed bugs in the Vite and PostCSS plugins: The v4.3.3 release lists several fixes under "Fixed". Before it, `@tailwindcss/vite` could trigger full page reloads. `@tailwindcss/postcss` could also miss rebuilds when Sass changed the input CSS. The same release fixed `--watch --poll` support in the CLI for unreliable file events. If you hit one of these on an older version, check that release first.

## Numbers (AgentGid data)
- Gid Score: 92.1 (#6 of all tools, 1 of 53 in its category)
- Used in 2,040 public projects set up for AI coding agents (32.6%)
- Downloads last week: 190,135,318 (as of 2026-11-24), +33.7% over 4 weeks
- GitHub stars: 98,720 (as of 2026-11-24)
- Last push: 2026-11-23

## Often used with
React 79.6%, Lucide React 59.2%, clsx 58.1%, Tailwind Merge 56.8%, Class Variance Authority 49.7%, Next.js 50.9%

## Checked alternatives (same job)
- Emotion: https://agentgid.com/tools/emotion/agent.md
- Sass: https://agentgid.com/tools/sass/agent.md
- styled-components: https://agentgid.com/tools/styled-components/agent.md

## Links
- AgentGid page: https://agentgid.com/tools/tailwindcss/
- Homepage: https://tailwindcss.com
- Repository: https://github.com/tailwindlabs/tailwindcss
- Source: https://github.com/tailwindlabs/tailwindcss#readme
- Source: https://github.com/tailwindlabs/tailwindcss
- Source: https://github.com/tailwindlabs/tailwindcss/releases
- Source: https://tailwindcss.com/


## Tailwind CSS: style pages with short class names

Tailwind CSS is a free tool for styling web pages. You or your AI assistant add short class names like p-6 or text-center right on the page elements, instead of writing a separate style file. Tailwind then builds one small style file with only the classes you used.

### Where to use it
- Style a new React or Vite app: The usual start for an app your assistant builds; one plugin line and one import, and every page can use the classes.
- Your brand colors as classes: Add your brand color once, and classes like bg-brand and text-brand appear for buttons, links and badges.
- Pages that fit phones and desktops: The same page shows one column on a phone and three on a laptop, by adding a screen size in front of a class.
- A dark version of the site: Add dark: in front of a color class, and the page switches colors in dark mode or when your own switch turns it on.
- Quick try-out in one HTML file: Test an idea or a layout in a single file with one script line, before setting up a real project.
- Styles for a site without Node.js: A plain HTML site, or one made by Python or PHP, gets its style file from Tailwind's single program, with nothing else to install.

### How to start
- Install Tailwind and its Vite plugin.

```
npm install tailwindcss @tailwindcss/vite
```

- Add the plugin to vite.config.ts, then import Tailwind in your main CSS file.

```
@import "tailwindcss";
```

- Run the dev server and use the classes in your pages.

```
npm run dev
```


### License
Free to use, also in paid and closed-source sites and apps, under the MIT license. The style files it makes for your pages are yours.

### Good to know
- Version 4 needs recent browsers (Safari 16.4, Chrome 111, Firefox 128 or newer). Sites that must work in older browsers stay on version 3.4.
- The one-line script version is for trying things out only, not for a live site.
- It is not meant to be mixed with Sass, Less or Stylus; it handles imports, nesting and browser prefixes itself.
- Tailwind only finds class names written out in full in your files; names glued together from pieces get no styles.
- The project is very active; version 4.3.5 came out on 6 November 2026.

Checked 2026-11-10 against: https://tailwindcss.com/, https://tailwindcss.com/docs/installation/using-vite, https://tailwindcss.com/docs/installation/play-cdn, https://tailwindcss.com/docs/installation/tailwind-cli, https://tailwindcss.com/docs/compatibility, https://tailwindcss.com/docs/upgrade-guide, https://tailwindcss.com/docs/detecting-classes-in-source-files, https://tailwindcss.com/docs/theme, https://tailwindcss.com/docs/dark-mode, https://tailwindcss.com/docs/responsive-design, https://github.com/tailwindlabs/tailwindcss/blob/main/LICENSE, https://github.com/tailwindlabs/tailwindcss/blob/main/CHANGELOG.md, https://registry.npmjs.org/tailwindcss/4.3.5, https://registry.npmjs.org/@tailwindcss/vite/4.3.5

### Mistakes to avoid
- Don't: @tailwind base; @tailwind components; @tailwind utilities;  (v3 lines in a v4 project) → Do: @import "tailwindcss"; (Version 4 replaced the @tailwind lines with a normal CSS import.)
- Don't: className={`bg-${color}-600 hover:bg-${color}-500`} → Do: Map each prop value to a full class string: { blue: "bg-blue-600 hover:bg-blue-500", red: "bg-red-600 hover:bg-red-500" } (Tailwind reads files as plain text, so a class name assembled at runtime never gets its styles.)
- Don't: Editing tailwind.config.js in a v4 project and expecting it to load → Do: Put colors, fonts and sizes in @theme inside the CSS file, or load the old file with @config "./tailwind.config.js" (v4 no longer finds the JavaScript config by itself.)
- Don't: Shipping a live site with the Play CDN script tag → Do: Build the CSS with the Vite plugin, PostCSS plugin or Tailwind CLI and link the built file (The Play CDN is meant only for trying things out.)
- Don't: v3 names in a v4 project, like outline-none for a hidden focus outline, ring for a 3px ring, or tailwindcss as a PostCSS plugin → Do: outline-hidden, ring-3, and the @tailwindcss/postcss package (v4 renamed several utilities and moved the PostCSS plugin into its own package.)

### Questions
- Can I use it in a paid product? Yes. It is MIT-licensed.
- Where did tailwind.config.js go in version 4? Settings now live in your CSS file in an @theme block. An old JavaScript config still works, but only if you load it with @config.
- How do I move a project from version 3 to 4? Run the official upgrade tool on a new branch, then review the changes; it needs Node.js 20 or newer.
- Why does a class I added do nothing? Usually the class name was built from pieces in code, so Tailwind never saw it. Write each full class name, for example in a lookup object.
- Can I use it without Node.js? Yes. The Tailwind command line tool is also offered as a standalone program.

---
AgentGid's catalog is curated: every entry was checked against the maker's official pages (registry, repository, license and pricing pages) on the date shown; a license value shows the quote it stands on wherever AgentGid has one. Usage numbers come from AgentGid's own scan of public repositories set up for AI coding agents. Claims by makers are reported, not tested by AgentGid.
