Ask any question about Tailwind CSS here... and get an instant response.
How do I customize colors in Tailwind config?
Asked on Nov 25, 2025
Answer
To customize colors in Tailwind CSS, you modify the `tailwind.config.js` file to extend or override the default color palette. This allows you to define custom colors that can be used throughout your project using Tailwind's utility classes.
<!-- BEGIN COPY / PASTE -->
module.exports = {
theme: {
extend: {
colors: {
primary: '#1DA1F2',
secondary: '#14171A',
accent: '#657786',
},
},
},
}
<!-- END COPY / PASTE -->Additional Comment:
- Place the `tailwind.config.js` file in the root of your project directory.
- Use the `extend` key to add new colors without removing Tailwind's default colors.
- Access your custom colors in your HTML using classes like `bg-primary`, `text-secondary`, etc.
- Run your build process after making changes to see them reflected in your project.
Recommended Links:
