Skip to content

Generates a JavaScript object with your colors as keys and desired tailwind classes as values. This makes it easier to add a color prop to your Vue.js components for instance without losing the ability to purge unused CSS before production.

License

Notifications You must be signed in to change notification settings

edoobox/tailwindcss-color-to-class

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

tailwindcss-color-to-class

Generates a JavaScript object with your colors as keys and desired tailwind classes as values. This makes it easier to add a color prop to your Vue.js components for instance without losing the ability to purge unused CSS before production.

Example

# Replaces the word 'color' in your classes with the names of the colors
COLORS=amber,blue,blueGray,lime,orange,pink,yellow CLASSES=bg-color-100,text-color-800 node main.js

# Output
{
  amber: 'bg-amber-100 text-amber-800',
  blue: 'bg-blue-100 text-blue-800',
  blueGray: 'bg-blueGray-100 text-blueGray-800',
  lime: 'bg-lime-100 text-lime-800',
  orange: 'bg-orange-100 text-orange-800',
  pink: 'bg-pink-100 text-pink-800',
  yellow: 'bg-yellow-100 text-yellow-800'
}

About

Generates a JavaScript object with your colors as keys and desired tailwind classes as values. This makes it easier to add a color prop to your Vue.js components for instance without losing the ability to purge unused CSS before production.

Resources

License

Stars

Watchers

Forks

Packages

No packages published