Ask any question about Tailwind CSS here... and get an instant response.
Post this Question & Answer:
How can I customize the default Tailwind theme to include custom colors?
Asked on Jan 02, 2026
Answer
To customize the default Tailwind theme with custom colors, you can extend the theme in your Tailwind configuration file. This allows you to add new color values while keeping the existing ones.
<!-- BEGIN COPY / PASTE -->
// tailwind.config.js
module.exports = {
theme: {
extend: {
colors: {
'custom-blue': '#1e40af',
'custom-green': '#10b981',
},
},
},
}
<!-- END COPY / PASTE -->Additional Comment:
- Place the new colors inside the `extend` object to avoid overriding existing Tailwind colors.
- Use these custom colors in your HTML by applying classes like `bg-custom-blue` or `text-custom-green`.
- Restart your development server after making changes to the configuration file to see the updates.
Recommended Links:
