Ask any question about Tailwind CSS here... and get an instant response.
Post this Question & Answer:
How can I create a custom color palette in Tailwind for my project?
Asked on Mar 19, 2026
Answer
To create a custom color palette in Tailwind CSS, you need to extend the default theme in your Tailwind configuration file. This allows you to add your own color values while still retaining the default colors.
<!-- BEGIN COPY / PASTE -->
// tailwind.config.js
module.exports = {
theme: {
extend: {
colors: {
brand: {
light: '#3AB0FF',
DEFAULT: '#007BFF',
dark: '#0056B3',
},
},
},
},
}
<!-- END COPY / PASTE -->Additional Comment:
- By extending the theme, you preserve Tailwind's default color palette and add your custom colors under a new key, such as "brand".
- You can use these custom colors in your HTML by applying classes like "bg-brand" or "text-brand-dark".
- Remember to restart your development server to see changes reflected in your project.
Recommended Links:
