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

How can I customize the default color palette in Tailwind?

Asked on Oct 03, 2025

Answer

To customize the default color palette in Tailwind CSS, you can extend or override the colors in your Tailwind configuration file. This allows you to define your own color scheme that fits your design needs.
<!-- BEGIN COPY / PASTE -->
    // tailwind.config.js
    module.exports = {
      theme: {
        extend: {
          colors: {
            primary: '#1DA1F2',
            secondary: '#14171A',
            accent: '#657786',
          },
        },
      },
    }
    <!-- END COPY / PASTE -->
Additional Comment:
  • Use the "extend" key to add new colors without removing Tailwind's default colors.
  • To completely replace the default colors, use the "colors" key directly instead of "extend".
  • After updating the configuration, rebuild your CSS to see the changes take effect.
  • Custom colors can be used with Tailwind's color utilities, like "bg-primary" or "text-secondary".
✅ Answered with Tailwind CSS best practices.

← Back to All Questions
The Q&A Network