Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 24 days 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 (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-06-27T11:01:05.000Z (over 3 years ago)
- Last Synced: 2024-10-01T15:58:41.234Z (about 1 month 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
[![Before](https://github.com/technikhil314/my-static-assets/raw/master/images/tw-apply-before.png)](https://github.com/technikhil314/my-static-assets/raw/master/images/tw-apply-before.png)
#### After
[![after](https://github.com/technikhil314/my-static-assets/raw/master/images/tw-apply-after.png)](https://github.com/technikhil314/my-static-assets/raw/master/images/tw-apply-after.png)
## Demo
[![demo](https://raw.githubusercontent.com/technikhil314/my-static-assets/master/terminal-casts/tailwind-apply-cli.svg)](https://raw.githubusercontent.com/technikhil314/my-static-assets/master/terminal-casts/tailwind-apply-cli.svg)
## License
[MIT](LICENSE)