@jiakun-zhao/unocss-preset 0.0.3 → 0.0.5
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/dist/index.d.mts +2 -2
- package/dist/index.mjs +33 -33
- package/package.json +3 -4
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Preset
|
|
1
|
+
import { Preset } from "unocss";
|
|
2
2
|
|
|
3
3
|
//#region src/index.d.ts
|
|
4
4
|
declare function neutralColor(light: number, dark: number, s?: number): string;
|
|
5
|
-
declare function export_default(): Preset
|
|
5
|
+
declare function export_default(): Preset;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { export_default as default, neutralColor };
|
package/dist/index.mjs
CHANGED
|
@@ -1,15 +1,43 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { fileURLToPath } from "node:url";
|
|
2
2
|
|
|
3
3
|
//#region package.json
|
|
4
4
|
var name = "@jiakun-zhao/unocss-preset";
|
|
5
5
|
var dependencies = {
|
|
6
6
|
"@fontsource-variable/geist": "^5.2.8",
|
|
7
|
-
"@fontsource-variable/geist-mono": "^5.2.7"
|
|
8
|
-
"mlly": "^1.8.0"
|
|
7
|
+
"@fontsource-variable/geist-mono": "^5.2.7"
|
|
9
8
|
};
|
|
10
9
|
|
|
11
10
|
//#endregion
|
|
12
11
|
//#region src/index.ts
|
|
12
|
+
const theme = {
|
|
13
|
+
animation: { keyframes: { "slide-enter": "{0%{transform:translateY(10px);opacity:0}to{transform:translateY(0);opacity:1}}" } },
|
|
14
|
+
fontFamily: {
|
|
15
|
+
mono: "\"Geist Mono Variable\",\"DM Mono\",\"IBM Plex Mono\",ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace",
|
|
16
|
+
sans: "\"Geist Variable\",ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Arial,Noto Sans,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",Segoe UI Symbol,\"Noto Color Emoji\""
|
|
17
|
+
},
|
|
18
|
+
textColor: { bland: {
|
|
19
|
+
DEFAULT: neutralColor(0, 100),
|
|
20
|
+
invert: neutralColor(100, 0),
|
|
21
|
+
neutral: neutralColor(92, 16)
|
|
22
|
+
} },
|
|
23
|
+
backgroundColor: { bland: {
|
|
24
|
+
DEFAULT: neutralColor(100, 0),
|
|
25
|
+
invert: neutralColor(0, 100),
|
|
26
|
+
neutral: neutralColor(92, 16),
|
|
27
|
+
card: neutralColor(98, 6),
|
|
28
|
+
destructive: neutralColor(45, 30, 75)
|
|
29
|
+
} },
|
|
30
|
+
borderColor: { bland: { card: { DEFAULT: neutralColor(92, 16) } } },
|
|
31
|
+
borderRadius: { "bland-card": "7px" },
|
|
32
|
+
height: { "bland-form": "2.3rem" },
|
|
33
|
+
zIndex: {
|
|
34
|
+
max: "2147483647",
|
|
35
|
+
min: "-2147483647"
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
function resolvePath(specifier) {
|
|
39
|
+
return fileURLToPath(import.meta.resolve(specifier));
|
|
40
|
+
}
|
|
13
41
|
function neutralColor(light, dark, s = 0) {
|
|
14
42
|
return `hsl(0 ${s}% calc( ${light}% + var(--theme-mode) * (${dark}% - ${light}% )))`;
|
|
15
43
|
}
|
|
@@ -52,37 +80,9 @@ function src_default() {
|
|
|
52
80
|
"bland-btn-outline": "bland-btn-reset bg-transparent hover:bg-bland-neutral b-2 b-solid b-bland-card",
|
|
53
81
|
"bland-btn-ghost": "bland-btn-reset bg-transparent hover:bg-bland-neutral"
|
|
54
82
|
}],
|
|
55
|
-
theme
|
|
56
|
-
animation: { keyframes: { "slide-enter": "{0%{transform:translateY(10px);opacity:0}to{transform:translateY(0);opacity:1}}" } },
|
|
57
|
-
fontFamily: {
|
|
58
|
-
mono: "\"Geist Mono Variable\",\"DM Mono\",\"IBM Plex Mono\",ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace",
|
|
59
|
-
sans: "\"Geist Variable\",ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Arial,Noto Sans,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",Segoe UI Symbol,\"Noto Color Emoji\""
|
|
60
|
-
},
|
|
61
|
-
textColor: { bland: {
|
|
62
|
-
DEFAULT: neutralColor(0, 100),
|
|
63
|
-
invert: neutralColor(100, 0),
|
|
64
|
-
neutral: neutralColor(92, 16)
|
|
65
|
-
} },
|
|
66
|
-
backgroundColor: { bland: {
|
|
67
|
-
DEFAULT: neutralColor(100, 0),
|
|
68
|
-
invert: neutralColor(0, 100),
|
|
69
|
-
neutral: neutralColor(92, 16),
|
|
70
|
-
card: neutralColor(98, 6),
|
|
71
|
-
destructive: neutralColor(45, 30, 75)
|
|
72
|
-
} },
|
|
73
|
-
borderColor: { bland: { card: { DEFAULT: neutralColor(92, 16) } } },
|
|
74
|
-
borderRadius: { "bland-card": "7px" },
|
|
75
|
-
height: { "bland-form": "2.3rem" },
|
|
76
|
-
zIndex: {
|
|
77
|
-
max: "2147483647",
|
|
78
|
-
min: "-2147483647"
|
|
79
|
-
}
|
|
80
|
-
},
|
|
83
|
+
theme,
|
|
81
84
|
preflights: [{ async getCSS() {
|
|
82
|
-
|
|
83
|
-
const paths = await Promise.all(fonts.map((it) => resolvePath(it)));
|
|
84
|
-
paths.push(await resolvePath(`${name}/reset.css`));
|
|
85
|
-
return paths.map((path) => `@import url(${JSON.stringify(path)});`).join("");
|
|
85
|
+
return [...Object.keys(dependencies).filter((it) => it.startsWith("@fontsource")), `${name}/reset.css`].map(resolvePath).map((path) => `@import url(${JSON.stringify(path)});`).join("");
|
|
86
86
|
} }]
|
|
87
87
|
};
|
|
88
88
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jiakun-zhao/unocss-preset",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.5",
|
|
5
5
|
"description": "",
|
|
6
6
|
"author": "Jiakun Zhao <hi@zhaojiakun.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -32,11 +32,10 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@fontsource-variable/geist": "^5.2.8",
|
|
35
|
-
"@fontsource-variable/geist-mono": "^5.2.7"
|
|
36
|
-
"mlly": "^1.8.0"
|
|
35
|
+
"@fontsource-variable/geist-mono": "^5.2.7"
|
|
37
36
|
},
|
|
38
37
|
"devDependencies": {
|
|
39
|
-
"@jiakun-zhao/eslint-config": "^4.
|
|
38
|
+
"@jiakun-zhao/eslint-config": "^4.2.0",
|
|
40
39
|
"@types/node": "^25.0.3",
|
|
41
40
|
"bumpp": "^10.3.2",
|
|
42
41
|
"eslint": "^9.39.2",
|