tailwind-apply-cli

A nodejs cli that generates a tailwind.css with @apply for most reused classStrings

Usage no npm install needed!

<script type="module">
  import tailwindApplyCli from 'https://cdn.skypack.dev/tailwind-apply-cli';
</script>

README

tailwind-apply-cli

A nodejs cli that generates a tailwind.css classes with @apply for most reused classStrings and replaces them in your html or templates

Installation

npm i tailwind-apply-cli

Usage

npx twapply <glob_pattern>

Example

This will generate className and tailwind.css for all class strings defined in the _.js and _.html files in current directory and its child directories

npx twapply "./**/*.(jsx|html)"

Sample input/output

Before

Before

After

after

Demo

demo

License

MIT