@unizap/unicss 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +9 -0
- package/README.md +49 -0
- package/bin/index.js +44 -0
- package/dist/index.js +131 -0
- package/package.json +32 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Your Name
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<p></p>
|
|
2
|
+
<p align="center">
|
|
3
|
+
<img src="https://ik.imagekit.io/unizap/unicss_logo.svg" alt="UniCSS Logo" height="80"/>
|
|
4
|
+
</p>
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<b>Build sleek interfaces straight from your markup.<br>
|
|
9
|
+
Fast, modern, utility-first CSS framework for rapid UI development.</b>
|
|
10
|
+
</p>
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## 🚀 Installation
|
|
15
|
+
|
|
16
|
+
```sh
|
|
17
|
+
npm i @unizap/unicss
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## âš¡ Usage
|
|
23
|
+
|
|
24
|
+
Generate your CSS file:
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
npx unicss
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Or watch for changes and output to a custom file:
|
|
31
|
+
|
|
32
|
+
```sh
|
|
33
|
+
npx unicss -w -o src/output.css
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## 🧩 Features
|
|
39
|
+
|
|
40
|
+
- Utility-first CSS generator
|
|
41
|
+
- Automatic CSS filter utilities (e.g. `blur-lg`, `brightness-150`)
|
|
42
|
+
- Fast, modern, and easy to integrate
|
|
43
|
+
- Supports custom output paths and watch mode
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## 📄 License
|
|
48
|
+
|
|
49
|
+
MIT
|
package/bin/index.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const path = require("path");
|
|
4
|
+
const fs = require("fs");
|
|
5
|
+
const generateCSS = require("../dist/index.js");
|
|
6
|
+
|
|
7
|
+
const args = process.argv.slice(2);
|
|
8
|
+
let outFile = "dist/unicss.css";
|
|
9
|
+
let watch = false;
|
|
10
|
+
|
|
11
|
+
for (let i = 0; i < args.length; i++) {
|
|
12
|
+
if ((args[i] === "-o" || args[i] === "--output") && args[i + 1]) {
|
|
13
|
+
outFile = args[i + 1];
|
|
14
|
+
i++;
|
|
15
|
+
}
|
|
16
|
+
if (args[i] === "-w" || args[i] === "--watch") {
|
|
17
|
+
watch = true;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function run() {
|
|
22
|
+
const css = generateCSS();
|
|
23
|
+
const outDir = path.dirname(outFile);
|
|
24
|
+
if (!fs.existsSync(outDir)) {
|
|
25
|
+
fs.mkdirSync(outDir, { recursive: true });
|
|
26
|
+
}
|
|
27
|
+
fs.writeFileSync(outFile, css);
|
|
28
|
+
console.log(`CSS generated at ${outFile}`);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
run();
|
|
32
|
+
|
|
33
|
+
if (watch) {
|
|
34
|
+
const chokidar = require("chokidar");
|
|
35
|
+
// Watch all HTML, JS, JSX, TS, TSX, VUE files in the project, plus the config
|
|
36
|
+
const watcher = chokidar.watch([
|
|
37
|
+
"**/*.{js,jsx,ts,tsx,html,vue}", // watch ALL folders, not just src/
|
|
38
|
+
"unicss.config.js"
|
|
39
|
+
], { ignoreInitial: true });
|
|
40
|
+
watcher.on("all", () => {
|
|
41
|
+
console.log("Change detected. Regenerating CSS...");
|
|
42
|
+
run();
|
|
43
|
+
});
|
|
44
|
+
}
|