https://github.com/kevinhellos/twscope
Library to prevent class bloating for Tailwind CSS
https://github.com/kevinhellos/twscope
Last synced: 2 months ago
JSON representation
Library to prevent class bloating for Tailwind CSS
- Host: GitHub
- URL: https://github.com/kevinhellos/twscope
- Owner: kevinhellos
- License: mit
- Created: 2024-04-25T01:13:47.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-25T01:19:14.000Z (about 2 years ago)
- Last Synced: 2026-01-01T21:51:25.468Z (6 months ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# twscope
Library to prevent class bloating for Tailwind CSS
## Setup
1. Add the twscope.js to the root directory of your project
2. Add the script.js to the root directory of your project
## [scope] tag
```html
Submit
// Import createScope
import createScope from "./twscope.js";
// Create and init the scope
var scope = createScope();
// Save classes name and assign it to the bind variable
scope.save("submitButton", "mt-5 ml-5 text-white bg-blue-700 hover:bg-blue-600 focus:ring-4 focus:ring-blue-300 font-medium rounded-md text-sm px-5 py-2.5 me-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800");
// Compile the scope
scope.compile();
```