Ask any question about Tailwind CSS here... and get an instant response.
How can I customize the default colors in Tailwind?
Asked on Dec 03, 2025
Answer
In Tailwind CSS, you can customize the default colors by extending the theme in your Tailwind configuration file. This allows you to add or modify color values to suit your design needs.
<!-- BEGIN COPY / PASTE -->
// tailwind.config.js
module.exports = {
theme: {
extend: {
colors: {
primary: '#1da1f2',
secondary: '#14171a',
accent: '#657786',
}
}
}
}
<!-- END COPY / PASTE -->Additional Comment:
- To apply these custom colors, use classes like "bg-primary" or "text-secondary" in your HTML.
- The "extend" key allows you to add new values without overriding the default Tailwind colors.
- Ensure your Tailwind CSS is properly configured to read this configuration file.
- Restart your build process after making changes to the configuration file to see updates.
Recommended Links:
