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 07, 2026
Answer
Creating a custom color palette in Tailwind CSS involves extending the default theme in your Tailwind configuration file. This allows you to define your own color values that can be used throughout your project.
<!-- BEGIN COPY / PASTE -->
// tailwind.config.js
module.exports = {
theme: {
extend: {
colors: {
customBlue: {
light: '#3a8dff',
DEFAULT: '#007bff',
dark: '#0056b3',
},
customGreen: {
light: '#6fcf97',
DEFAULT: '#27ae60',
dark: '#1e8449',
},
},
},
},
}
<!-- END COPY / PASTE -->Additional Comment:
- To apply these custom colors, use classes like "bg-customBlue" or "text-customGreen-dark" in your HTML.
- Ensure your build process includes the updated Tailwind configuration to reflect these changes.
- Custom colors can be used for backgrounds, text, borders, and more, offering flexibility in design.
- Consider naming conventions that are intuitive and consistent with your project's design language.
Recommended Links:
