0.0.4 • Published 1 year ago

@doeanderson/tailwindcss-color-vars v0.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Tailwind CSS Color Vars Plugin

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.

Usage

yarn add --dev @doeanderson/tailwindcss-color-vars

Add the following plugin to your tailwind.config.js file:

require('./tailwind-colors-plugin')({
  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.

License

MIT License