Ask any question about Tailwind CSS here... and get an instant response.
How do I customize the default color palette in Tailwind?
Asked on Nov 21, 2025
Answer
To customize the default color palette in Tailwind CSS, you need to extend or override the colors in your Tailwind configuration file. This allows you to define your own color scheme that will be used throughout your project.
<!-- BEGIN COPY / PASTE -->
// tailwind.config.js
module.exports = {
theme: {
extend: {
colors: {
primary: '#1D4ED8',
secondary: '#9333EA',
accent: '#F59E0B',
},
},
},
}
<!-- END COPY / PASTE -->Additional Comment:
- Use the "extend" key to add new colors without removing existing ones.
- To completely override the default colors, use the "colors" key directly instead of "extend".
- After updating the configuration, run your build process to see the changes in your project.
- Custom colors can be used with Tailwind's utility classes like "bg-primary" or "text-secondary".
Recommended Links:
