How can I customize the default Tailwind theme colors?
Asked on Sep 30, 2025
Answer
To customize the default Tailwind theme colors, you can extend the theme configuration in your `tailwind.config.js` file. This allows you to add or modify color values to suit your project's design needs.
<!-- BEGIN COPY / PASTE -->
// tailwind.config.js
module.exports = {
theme: {
extend: {
colors: {
primary: '#1DA1F2',
secondary: '#14171A',
accent: '#657786',
},
},
},
}
<!-- END COPY / PASTE -->Additional Comment:
- Use the `extend` key to add new colors without overriding existing ones.
- Define colors using hex codes, RGB, or HSL values as needed.
- After updating the configuration, rebuild your Tailwind CSS to apply changes.
- These custom colors can be used with Tailwind's color utilities like `bg-primary` or `text-secondary`.
Recommended Links: