-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathuno.config.ts
87 lines (84 loc) · 2.2 KB
/
uno.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
import unocss from "unocss/astro";
import presetUno from "unocss/preset-uno";
import presetTypography from "unocss/preset-typography";
import kebabCase from "lodash/kebabCase.js";
function createMapping(label: string, sizes: number[]) {
return Object.fromEntries(
sizes.map((size) => [size, `var(--${label}-${size})`]),
);
}
function variables(variables: string[]) {
return Object.fromEntries(
variables.map((a) => [a, `var(--${kebabCase(a)})`]),
);
}
export default unocss({
presets: [
presetUno(),
presetTypography({
cssExtend: {
"pre>code": {
"min-width": "max-content",
display: "block",
width: "100%",
},
"pre,code": {
"word-break": "inherit",
"white-space": "inherit",
},
"pre > code": {
"word-break": "unset",
},
code: {
"white-space": "pre-line",
"word-break": "break-word",
"line-height": "150%",
},
p: {
"line-height": "1.8",
},
},
}),
],
rules: [["text-wrap-balance", { "text-wrap": "balance" }]],
theme: {
fontFamily: {
display: "var(--font-family-sans)",
sans: "var(--font-family-sans)",
article: "var(--font-family-article)",
articleTitle: "var(--font-family-article-title)",
},
colors: {
...variables([
"highlight",
// whatsapp
"whatsappChatBackgroundOutgoing",
"whatsappChatBackgroundIncoming",
"whatsappChatMeta",
"whatsappChatText",
"whatsappChatNumber",
// discord
"discordBackground",
"discordText",
"discordReactionBackground",
"discordReactionReactedBackground",
"discordReactionReactedBorder",
"discordEmbedBackground",
"discordPrimary500",
]),
brand: createMapping(
"brand",
[100, 200, 300, 400, 500, 600, 700, 800, 900],
),
body: createMapping(
"body",
[100, 200, 300, 400, 500, 600, 700, 800, 900],
),
text: createMapping(
"text",
[100, 200, 300, 400, 500, 600, 700, 800, 900],
),
gap: createMapping("gap", [1, 2, 3, 4, 5]),
},
},
});