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 CSS?
Asked on Feb 05, 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 new colors or override existing ones.
<!-- BEGIN COPY / PASTE -->
// tailwind.config.js
module.exports = {
theme: {
extend: {
colors: {
customBlue: {
light: '#3a86ff',
DEFAULT: '#00509e',
dark: '#001f54',
},
customGreen: '#00f5d4',
},
},
},
}
<!-- END COPY / PASTE -->Additional Comment:
- Use the "extend" key to add new colors without removing Tailwind's default colors.
- Define colors using either a single value or an object for different shades.
- After updating the configuration, you can use these colors in your HTML with classes like "bg-customBlue" or "text-customGreen".
- Remember to rebuild your CSS if using a build tool to see the changes.
Recommended Links:
