@jiakun-zhao/unocss-preset 0.0.4 → 0.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/dist/index.d.mts +2 -2
- package/dist/index.mjs +39 -37
- package/package.json +1 -1
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
|
@@ -9,6 +9,35 @@ var dependencies = {
|
|
|
9
9
|
|
|
10
10
|
//#endregion
|
|
11
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
|
+
}
|
|
12
41
|
function neutralColor(light, dark, s = 0) {
|
|
13
42
|
return `hsl(0 ${s}% calc( ${light}% + var(--theme-mode) * (${dark}% - ${light}% )))`;
|
|
14
43
|
}
|
|
@@ -37,54 +66,27 @@ function src_default() {
|
|
|
37
66
|
})]
|
|
38
67
|
],
|
|
39
68
|
shortcuts: [{
|
|
69
|
+
"no-tap-highlight": "[-webkit-tap-highlight-color:transparent]",
|
|
40
70
|
"pb-safe": "pb-[env(safe-area-inset-bottom)]",
|
|
41
|
-
"theme-light": "[--theme-mode:0]",
|
|
42
|
-
"theme-dark": "[--theme-mode:1]",
|
|
43
71
|
"theme-auto": "theme-light dark:theme-dark",
|
|
44
|
-
"
|
|
72
|
+
"theme-dark": "[--theme-mode:1]",
|
|
73
|
+
"theme-light": "[--theme-mode:0]"
|
|
45
74
|
}, {
|
|
46
|
-
"bland-card": "bg-bland-card b-1 b-solid b-bland-card rd-bland-card",
|
|
47
|
-
"bland-btn-reset": "rd-bland-card h-bland-form font-600 px-3",
|
|
48
|
-
"bland-btn": "bland-btn-reset bg-bland-invert hover:bg-bland-invert:80 text-bland-invert",
|
|
49
|
-
"bland-btn-secondary": "bland-btn-reset bg-bland-neutral hover:bg-bland-neutral:80",
|
|
50
75
|
"bland-btn-destructive": "bland-btn-reset bg-bland-destructive hover:bg-bland-destructive:80 text-white",
|
|
76
|
+
"bland-btn-ghost": "bland-btn-reset bg-transparent hover:bg-bland-neutral",
|
|
51
77
|
"bland-btn-outline": "bland-btn-reset bg-transparent hover:bg-bland-neutral b-2 b-solid b-bland-card",
|
|
52
|
-
"bland-btn-
|
|
78
|
+
"bland-btn-reset": "rd-bland-card h-bland-form font-600 px-3",
|
|
79
|
+
"bland-btn-secondary": "bland-btn-reset bg-bland-neutral hover:bg-bland-neutral:80",
|
|
80
|
+
"bland-btn": "bland-btn-reset bg-bland-invert hover:bg-bland-invert:80 text-bland-invert",
|
|
81
|
+
"bland-card": "bg-bland-card b-1 b-solid b-bland-card rd-bland-card",
|
|
82
|
+
"bland-input-text": "bg-bland-card b-1 b-solid b-bland-card rd-bland-card h-bland-form px-3"
|
|
53
83
|
}],
|
|
54
|
-
theme
|
|
55
|
-
animation: { keyframes: { "slide-enter": "{0%{transform:translateY(10px);opacity:0}to{transform:translateY(0);opacity:1}}" } },
|
|
56
|
-
fontFamily: {
|
|
57
|
-
mono: "\"Geist Mono Variable\",\"DM Mono\",\"IBM Plex Mono\",ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace",
|
|
58
|
-
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\""
|
|
59
|
-
},
|
|
60
|
-
textColor: { bland: {
|
|
61
|
-
DEFAULT: neutralColor(0, 100),
|
|
62
|
-
invert: neutralColor(100, 0),
|
|
63
|
-
neutral: neutralColor(92, 16)
|
|
64
|
-
} },
|
|
65
|
-
backgroundColor: { bland: {
|
|
66
|
-
DEFAULT: neutralColor(100, 0),
|
|
67
|
-
invert: neutralColor(0, 100),
|
|
68
|
-
neutral: neutralColor(92, 16),
|
|
69
|
-
card: neutralColor(98, 6),
|
|
70
|
-
destructive: neutralColor(45, 30, 75)
|
|
71
|
-
} },
|
|
72
|
-
borderColor: { bland: { card: { DEFAULT: neutralColor(92, 16) } } },
|
|
73
|
-
borderRadius: { "bland-card": "7px" },
|
|
74
|
-
height: { "bland-form": "2.3rem" },
|
|
75
|
-
zIndex: {
|
|
76
|
-
max: "2147483647",
|
|
77
|
-
min: "-2147483647"
|
|
78
|
-
}
|
|
79
|
-
},
|
|
84
|
+
theme,
|
|
80
85
|
preflights: [{ async getCSS() {
|
|
81
86
|
return [...Object.keys(dependencies).filter((it) => it.startsWith("@fontsource")), `${name}/reset.css`].map(resolvePath).map((path) => `@import url(${JSON.stringify(path)});`).join("");
|
|
82
87
|
} }]
|
|
83
88
|
};
|
|
84
89
|
}
|
|
85
|
-
function resolvePath(specifier) {
|
|
86
|
-
return fileURLToPath(import.meta.resolve(specifier));
|
|
87
|
-
}
|
|
88
90
|
|
|
89
91
|
//#endregion
|
|
90
92
|
export { src_default as default, neutralColor };
|