Tailwind CSS Q&A Logo
Tailwind CSS Q&A Part of the Q&A Network
Q&A Logo

How do I customize the Tailwind color palette for my project?

Asked on Oct 21, 2025

Answer

To customize the Tailwind color palette, you need to extend the default theme in your Tailwind configuration file. This allows you to add new colors or modify existing ones to fit your project's design requirements.
<!-- BEGIN COPY / PASTE -->
    // tailwind.config.js
    module.exports = {
      theme: {
        extend: {
          colors: {
            brand: {
              light: '#3AB0FF',
              DEFAULT: '#007BFF',
              dark: '#0056B3',
            },
          },
        },
      },
    }
    <!-- END COPY / PASTE -->
Additional Comment:
  • Use the "extend" key to add or modify colors without removing the default palette.
  • Define colors using hexadecimal, RGB, or HSL values as needed.
  • Access your custom colors in your HTML using classes like "bg-brand" or "text-brand-dark".
  • Run "npx tailwindcss build" to apply changes if you're using a build tool.
✅ Answered with Tailwind CSS best practices.

← Back to All Questions
The Q&A Network