50#ffffff
100#f7f7f7
200#efefef
300#e7e7e7
400#dfdfdf
500#d7d7d7
600#cfcfcf
700#c8c8c8
800#c0c0c0
900#b8b8b8
950#b1b1b1
How to Install
1
Open your tailwind.config.js file
Locate the configuration file in your project's root directory.
2
Add the color palette to your theme
Copy the following configuration into your theme's colors section:
module.exports = {
theme: {
extend: {
colors: {
custom: {
50: '#ffffff',
100: '#f7f7f7',
200: '#efefef',
300: '#e7e7e7',
400: '#dfdfdf',
500: '#d7d7d7',
600: '#cfcfcf',
700: '#c8c8c8',
800: '#c0c0c0',
900: '#b8b8b8',
950: '#b1b1b1',
},
},
},
},
plugins: [],
}3
Use the colors in your HTML/JSX
You can now use your custom colors with Tailwind utility classes:
<!-- Background color -->
<div class="bg-custom-500">...</div>
<!-- Text color -->
<p class="text-custom-700">...</p>
<!-- Border color -->
<div class="border-custom-300">...</div>
<!-- Hover states -->
<button class="bg-custom-500 hover:bg-custom-600">...</button>Alternative: CSS Variables
If you prefer using CSS custom properties, here are the variables:
:root {
--color-custom-50: #ffffff;
--color-custom-100: #f7f7f7;
--color-custom-200: #efefef;
--color-custom-300: #e7e7e7;
--color-custom-400: #dfdfdf;
--color-custom-500: #d7d7d7;
--color-custom-600: #cfcfcf;
--color-custom-700: #c8c8c8;
--color-custom-800: #c0c0c0;
--color-custom-900: #b8b8b8;
--color-custom-950: #b1b1b1;
}Individual Color Values
custom-50
#ffffff
custom-100
#f7f7f7
custom-200
#efefef
custom-300
#e7e7e7
custom-400
#dfdfdf
custom-500
#d7d7d7
custom-600
#cfcfcf
custom-700
#c8c8c8
custom-800
#c0c0c0
custom-900
#b8b8b8
custom-950
#b1b1b1
Learn more about customizing colors in Tailwind CSS