Tailwind's default color palette is excellent, but every brand needs custom colors. Whether you're matching a brand guide or creating a unique aesthetic, extending Tailwind's colors is essential for professional projects.
Understanding Tailwind's Color System
Tailwind uses a numeric scale from 50 (lightest) to 950 (darkest) for each color. This creates predictable, accessible color ramps that work across your entire design.
Default Scale: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950
Extending the Default Palette
The cleanest approach is extending (not replacing) Tailwind's colors:
Now you can use classes like bg-brand-500, text-brand-700, etc.
Creating Shade Scales
Generating a complete 11-shade scale manually is tedious. Here are better approaches:
Method 1: Online Generators
- UI Colors: uicolors.app/create - Paste your hex, get Tailwind scale
- Tailwind Shades: tailwindshades.com - Auto-generate from single color
- Coolors: coolors.co - Create scales, export for Tailwind
Method 2: Using theme()
Reference existing Tailwind colors in your config:
Method 3: Single Color (Simplified)
If you only need one shade:
Use with: bg-brand, text-brand, etc.
Complete Brand Color System
A professional setup with semantic naming:
Using with theme()
Access your custom colors in CSS or other config values:
Or in CSS with @apply:
Configuration Best Practices
1. Use Semantic Names
Name colors by purpose, not appearance:
- Good:
primary,secondary,accent - Bad:
blue,lightBlue,darkBlue
2. Keep DEFAULT Shade
Always define a DEFAULT shade for simple class names:
3. Document Your System
Add comments explaining color usage:
Opacity Modifiers
Tailwind v3+ supports opacity modifiers out of the box:
Dark Mode Colors
Define different colors for dark mode:
Text that adapts
Or configure globally:
Plugin Recommendations
1. @tailwindcss/forms
Better form styling that respects custom colors:
2. tailwindcss-animate
Smooth animations using your custom colors:
Exporting for Design Tools
Share your Tailwind colors with designers:
For Figma
- Use Tailwind CSS Figma Plugin
- Import your config directly into Figma
- Sync changes automatically
For Adobe XD
- Use Tailwind CSS XD Plugin
- Generate color swatches from config
Real Project Example
Here's a complete, production-ready configuration:
Testing Your Colors
- Contrast Check: Test all text/background combinations for WCAG compliance
- Dark Mode: Verify colors work in both light and dark themes
- Color Blind: Use simulators to test accessibility
- Print Styles: Ensure colors translate to @media print
Common Mistakes
1. Replacing Instead of Extending
Don't do this (loses all default colors):
Do this instead:
2. Incomplete Scales
If you define some shades, define them all. Missing shades break utility classes.
3. Poor Naming
Avoid names tied to specific colors—they become confusing when you rebrand.
Conclusion
Custom colors in Tailwind are straightforward once you understand the config structure. Use extending (not replacing), maintain complete shade scales, choose semantic names, and document your system. With these practices, your Tailwind colors will be maintainable, scalable, and designer-friendly.