Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add new colors to tailwind-css and keep the original ones?

Tags:

tailwind-css

How can I add colors to default scheme? Here is my tailwindcss file.

const { colors: defaultColors } = require('tailwindcss/defaultTheme')

module.exports = {
    "theme": {
        "colors": defaultColors + {
            "custom-yellow": {
                "500": "#EDAE0A",
            }
        },
    },
};
like image 729
Melis Lekesiz Avatar asked Oct 02 '20 17:10

Melis Lekesiz


People also ask

How do I add more colors to Tailwind CSS?

You can easily add new colors to Tailwind CSS and keep the originals ones using customization configuration. You can configure your colors under the colors key in the theme section of your tailwind. config. js file.


1 Answers

Add your custom color values to theme > extend > colors section in tailwind.config.js

//tailwind.config.js
  module.exports = {
    theme: {
      extend: {
        colors: {
          'custom-yellow':'#BAA333',
        }
      },
    },  
  }
like image 154
victoryoalli Avatar answered Sep 27 '22 20:09

victoryoalli