Skip to main content
Tailwind CSS v4 provides a comprehensive default color palette using OKLCH color space, and offers flexible ways to customize colors for your design system.

Default Color Palette

Tailwind includes these color families by default:

Color Examples

Here are some colors from the default palette:

Adding Custom Colors

Define custom colors using the @theme directive:

Using Custom Colors

Once defined, custom colors work with all color utilities:

Color Formats

Tailwind supports multiple color formats:
OKLCH is recommended for its perceptual uniformity and wider color gamut. Colors defined in OKLCH will look more consistent across different shades.

Opacity Modifiers

All colors support opacity modifiers out of the box:

Special Colors

Tailwind provides special color keywords:
Usage:

JavaScript Configuration

Define colors in your configuration file:
tailwind.config.ts

Importing Default Colors

Use the default color palette in your config:

Dynamic Colors with CSS Variables

Create dynamic themes using CSS variables:

Color Utilities

These utilities accept color values:
  • Text: text-{color}
  • Background: bg-{color}
  • Border: border-{color}
  • Outline: outline-{color}
  • Ring: ring-{color}
  • Shadow: shadow-{color}
  • Accent: accent-{color}
  • Caret: caret-{color}
  • Fill: fill-{color}
  • Stroke: stroke-{color}
  • Decoration: decoration-{color}
  • Divide: divide-{color}
  • Placeholder: placeholder-{color}

Removing Colors

Remove default colors:
Removing all colors with --color-*: initial will remove even the special colors like transparent, current, black, and white. Make sure to redefine any colors you need.

Color Function

Access colors in your configuration: