Ask any question about Tailwind CSS here... and get an instant response.
Post this Question & Answer:
How can I customize the default color palette in Tailwind CSS?
Asked on May 23, 2026
Answer
To customize the default color palette in Tailwind CSS, you need to modify the `tailwind.config.js` file by extending or overriding the `colors` section. This allows you to add your own colors or modify existing ones.
// BEGIN COPY / PASTE
module.exports = {
theme: {
extend: {
colors: {
primary: '#1DA1F2',
secondary: '#14171A',
accent: '#657786',
},
},
},
}
// END COPY / PASTEAdditional Comment:
- Use the `extend` key to add new colors without removing Tailwind's default colors.
- To completely replace the default colors, define the `colors` key directly under `theme`.
- After updating the configuration, rebuild your CSS to apply the changes.
Recommended Links:
