Tailwind CSS plugin to easily manage colors via CSS variables. Pass an object of colors defined in RGB format and the theme's colors
, fill
and stroke
will automatically have them, as well as a CSS variable for each color added to the document root.
yarn add --dev @doeanderson/tailwindcss-color-vars
Add the following plugin to your tailwind.config.js
file:
require('@doeanderson/tailwindcss-color-vars')({
colorName: 'R G B',
})
If you want variants of one color, you can format it like this:
{
colorName: {
light: 'R G B',
DEFAULT: 'R G B',
},
}
Additionally, you can still extend or override colors via the standard theme configuration property.
MIT License