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