vida-css 0.0.1 → 0.0.2
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/README.md +58 -0
- package/dist/vida.css +1 -1
- package/package.json +33 -9
- package/scripts/cli.js +38 -0
- package/scripts/generate.js +302 -0
- package/scripts/generator.js +718 -0
- package/scripts/scanner.js +32 -0
- package/vida.config.js +53 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// scripts/scanner.js
|
|
2
|
+
import fs from "fs";
|
|
3
|
+
import path from "path";
|
|
4
|
+
|
|
5
|
+
const extensions = [".html", ".js", ".jsx", ".ts", ".tsx", ".vue"];
|
|
6
|
+
|
|
7
|
+
export function scanClasses(dir) {
|
|
8
|
+
const classes = new Set();
|
|
9
|
+
|
|
10
|
+
function walk(folder) {
|
|
11
|
+
const files = fs.readdirSync(folder);
|
|
12
|
+
files.forEach(file => {
|
|
13
|
+
const fullPath = path.join(folder, file);
|
|
14
|
+
const stat = fs.statSync(fullPath);
|
|
15
|
+
if (stat.isDirectory()) { walk(fullPath); return; }
|
|
16
|
+
|
|
17
|
+
if (!extensions.includes(path.extname(file))) return;
|
|
18
|
+
|
|
19
|
+
const content = fs.readFileSync(fullPath, "utf8");
|
|
20
|
+
// Capture class attribute values without breaking on nested quotes.
|
|
21
|
+
// Example Tailwind arbitrary: content-[''] must remain intact inside the attribute.
|
|
22
|
+
const regex = /class(Name)?=(["'])(.*?)\2/g;
|
|
23
|
+
let match;
|
|
24
|
+
while ((match = regex.exec(content))) {
|
|
25
|
+
match[3].split(/\s+/).forEach(cls => { if (cls) classes.add(cls); });
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
walk(dir);
|
|
31
|
+
return Array.from(classes);
|
|
32
|
+
}
|
package/vida.config.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// vida.config.js
|
|
2
|
+
export default {
|
|
3
|
+
colors: {
|
|
4
|
+
black: "#000000",
|
|
5
|
+
white: "#ffffff",
|
|
6
|
+
gray: {
|
|
7
|
+
50:"#f9fafb",
|
|
8
|
+
100:"#f3f4f6",
|
|
9
|
+
200:"#e5e7eb",
|
|
10
|
+
300:"#d1d5db",
|
|
11
|
+
400:"#9ca3af",
|
|
12
|
+
500:"#6b7280",
|
|
13
|
+
600:"#4b5563",
|
|
14
|
+
700:"#374151",
|
|
15
|
+
800:"#1f2937",
|
|
16
|
+
900:"#111827"
|
|
17
|
+
},
|
|
18
|
+
red: { 100:"#fee2e2", 300:"#fca5a5", 500:"#ef4444", 600:"#dc2626", 700:"#b91c1c", 900:"#5a0c0c" },
|
|
19
|
+
blue: { 100:"#dbeafe", 300:"#93c5fd", 500:"#3b82f6", 600:"#2563eb", 700:"#1d4ed8", 900:"#0d1f53" },
|
|
20
|
+
green: { 100:"#dcfce7", 300:"#86efac", 500:"#22c55e", 600:"#16a34a", 700:"#15803d", 900:"#063a1a" },
|
|
21
|
+
yellow: { 100:"#fef9c3", 300:"#fde047", 500:"#eab308", 600:"#ca8a04", 700:"#a16207", 900:"#7a4b09" },
|
|
22
|
+
purple: { 100:"#f3e8ff", 300:"#d8b4fe", 500:"#a855f7", 600:"#9333ea", 700:"#7e22ce", 900:"#361057" },
|
|
23
|
+
indigo: { 100:"#e0e7ff", 300:"#a5b4fc", 500:"#6366f1", 600:"#4f46e5", 700:"#4338ca", 900:"#312e81" },
|
|
24
|
+
pink: { 100:"#fce7f3", 300:"#f9a8d4", 500:"#ec4899", 600:"#db2777", 700:"#be185d", 900:"#831843" },
|
|
25
|
+
orange: { 100:"#ffedd5", 300:"#fdba74", 500:"#f97316", 600:"#ea580c", 700:"#c2410c", 900:"#7c2d12" },
|
|
26
|
+
teal: { 100:"#ccfbf1", 300:"#5eead4", 500:"#14b8a6", 600:"#0d9488", 700:"#0f766e", 900:"#134e4a" },
|
|
27
|
+
cyan: { 100:"#cffafe", 300:"#67e8f9", 500:"#06b6d4", 600:"#0891b2", 700:"#0e7490", 900:"#164e63" },
|
|
28
|
+
slate: { 100:"#f1f5f9", 300:"#cbd5e1", 500:"#64748b", 600:"#475569", 700:"#334155", 900:"#0f172a" }
|
|
29
|
+
},
|
|
30
|
+
spacing: { 1: "4px", 2: "8px", 3: "12px", 4: "16px", 5: "20px", 6: "24px", 7: "28px", 8: "32px", 9: "36px", 10: "40px" },
|
|
31
|
+
borderRadius: { sm: "4px", md: "8px", lg: "12px" },
|
|
32
|
+
fontFamily: {
|
|
33
|
+
sans: "\"Space Grotesk\", \"Segoe UI\", \"Helvetica Neue\", sans-serif",
|
|
34
|
+
display: "\"Space Grotesk\", \"Segoe UI\", \"Helvetica Neue\", sans-serif",
|
|
35
|
+
serif: "\"Source Serif 4\", \"Times New Roman\", serif",
|
|
36
|
+
mono: "\"JetBrains Mono\", \"SFMono-Regular\", Menlo, Consolas, \"Liberation Mono\", monospace"
|
|
37
|
+
},
|
|
38
|
+
screens: { sm: "640px", md: "768px", lg: "1024px", xl: "1280px" },
|
|
39
|
+
// Tailwind-like state variants supported by the generator.
|
|
40
|
+
variants: ["hover", "focus", "focus-visible", "active", "disabled", "visited", "dark"],
|
|
41
|
+
sizeScale: {
|
|
42
|
+
0: "0px", 1: "4px", 2: "8px", 3: "12px", 4: "16px", 5: "20px", 6: "24px",
|
|
43
|
+
8: "32px", 10: "40px", 12: "48px", 16: "64px", 20: "80px", 24: "96px",
|
|
44
|
+
32: "128px", 40: "160px", 48: "192px", 56: "224px", 64: "256px", 72: "288px",
|
|
45
|
+
80: "320px", 96: "384px"
|
|
46
|
+
},
|
|
47
|
+
// Remaining registries are kept for backward compatibility with older code paths.
|
|
48
|
+
flex: ["flex", "inline-flex"],
|
|
49
|
+
flexDirection: ["flex-row", "flex-col", "flex-row-reverse", "flex-col-reverse"],
|
|
50
|
+
flexAlignment: ["justify-start","justify-center","justify-end","justify-between","items-start","items-center","items-end"],
|
|
51
|
+
grid: ["grid","grid-cols-2","grid-cols-3"],
|
|
52
|
+
textAlign: ["text-left","text-center","text-right"]
|
|
53
|
+
};
|