Skip to content

A Tailwind CSS plugin for extracting theme colors as global variables.

Notifications You must be signed in to change notification settings

neupauer/tailwindcss-plugin-colors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tailwind CSS Plugin – Colors

Plugin for extracting theme colors as global variables.

Install

  1. Install the plugin:
# Using npm
npm install @neupauer/tailwindcss-plugin-colors

# Using Yarn
yarn add @neupauer/tailwindcss-plugin-colors
  1. Add it to your tailwind.config.js file:
// tailwind.config.js
module.exports = {
  // ...
  plugins: [require("@neupauer/tailwindcss-plugin-colors")],
};

// With Optional Config
module.exports = {
  // ...
  plugins: [
    require("@neupauer/tailwindcss-plugin-colors")({
      // prefix: "",          // No Prefix       --blue-500
      // prefix: "tw-color",  // Default Prefix  --tw-color-blue-500
      prefix: "my-prefix",    // Custom Prefix   --my-prefix-blue-500
    }),
  ],
};

Usage

<div style="color: var(--tw-color-blue-500)"></div>

About

A Tailwind CSS plugin for extracting theme colors as global variables.

Resources

Stars

Watchers

Forks

Packages