https://github.com/technikhil314/tailwind-apply-cli
A nodejs cli that generates a tailwind.css with apply directive for most reused class strings
https://github.com/technikhil314/tailwind-apply-cli
cli css nodejs-cli reused-classstrings tailwind tailwind-css tailwindcss web webapp
Last synced: 3 months ago
JSON representation
A nodejs cli that generates a tailwind.css with apply directive for most reused class strings
- Host: GitHub
- URL: https://github.com/technikhil314/tailwind-apply-cli
- Owner: technikhil314
- License: mit
- Created: 2021-05-09T07:49:28.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-06-27T11:01:05.000Z (almost 4 years ago)
- Last Synced: 2025-03-02T08:42:30.939Z (4 months ago)
- Topics: cli, css, nodejs-cli, reused-classstrings, tailwind, tailwind-css, tailwindcss, web, webapp
- Language: JavaScript
- Homepage:
- Size: 491 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
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
```bash
npm i tailwind-apply-cli
```## Usage
```bash
npx twapply
```## 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
```bash
npx twapply "./**/*.(jsx|html)"
```### Sample input/output
#### Before
[](https://github.com/technikhil314/my-static-assets/raw/master/images/tw-apply-before.png)
#### After
[](https://github.com/technikhil314/my-static-assets/raw/master/images/tw-apply-after.png)
## Demo
[](https://raw.githubusercontent.com/technikhil314/my-static-assets/master/terminal-casts/tailwind-apply-cli.svg)
## License
[MIT](LICENSE)