Tailwind Color Utility Prefixes Overview
Tailwind CSS applies color variables across every visual DOM property. The standard prefixes include:
- `bg-{color}-{stop}`: Background color (`background-color`)
- `text-{color}-{stop}`: Text color (`color`)
- `border-{color}-{stop}`: Border color (`border-color`)
- `ring-{color}-{stop}`: Focus ring outline (`box-shadow` ring)
- `divide-{color}-{stop}`: Border divider between child elements
- `outline-{color}-{stop}`: Native browser outline color
- `accent-{color}-{stop}`: Form checkbox & radio accent color
- `caret-{color}-{stop}`: Input text cursor color
- `fill-{color}-{stop}`: SVG path fill color
- `stroke-{color}-{stop}`: SVG path stroke outline color
All 22 Default Color Families in v4
Tailwind CSS v4 ships with 22 built-in color families, each containing 11 numeric stops (50 to 950):
1. Neutrals: - **Slate**: Cool blue-tinted grays (`slate-50` to `slate-950`) - **Gray**: Standard balanced grays (`gray-50` to `gray-950`) - **Zinc**: Cool technical grays (`zinc-50` to `zinc-950`) - **Neutral**: Pure neutral grays (`neutral-50` to `neutral-950`) - **Stone**: Warm organic grays (`stone-50` to `stone-950`)
2. Vivid Accents: - **Red**, **Orange**, **Amber**, **Yellow**, **Lime**, **Green**, **Emerald**, **Teal**, **Cyan**, **Sky**, **Blue**, **Indigo**, **Violet**, **Purple**, **Fuchsia**, **Pink**, **Rose**
Neutral Gray Families Comparison (Slate, Zinc, Neutral, Stone)
| Gray Name | Hex Anchor (500) | Perceptual Tone | Suggested Use |
|---|---|---|---|
| Slate | `#64748b` | Cool Slate Blue | Developer Dashboards & SaaS |
| Zinc | `#71717a` | Cool Metallic Technical | Modern Clean Interfaces |
| Neutral | `#737373` | Pure Balanced Neutral | Enterprise Apps & Typography |
| Stone | `#78716c` | Warm Earthy Stone | Editorial & Blog Reading UIs |
Opacity Modifiers & Alpha Syntax
In Tailwind CSS v4, arbitrary opacity values can be appended to any color utility class using the forward slash (`/`) syntax:
<!-- Background with 10% opacity and border with 20% opacity -->
<div className="bg-primary/10 text-primary p-4 border border-primary/20 rounded-xl">
Callout Banner
</div>Author Insight: Standardizing Class Prefixes
Author Insight by Abhay Vachhani (Full Stack Engineer): > In enterprise engineering teams using Prettier with `prettier-plugin-tailwindcss`, color class names are automatically sorted into standard execution order. Enforcing automated class sorting prevents merge conflicts across large git repositories.