-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathunocss.config.js
56 lines (52 loc) · 1.32 KB
/
unocss.config.js
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
import {
defineConfig,
presetAttributify,
presetIcons,
presetTypography,
presetUno,
transformerDirectives,
transformerVariantGroup,
} from "unocss";
import { fileURLToPath } from "url";
import { dirname, resolve } from "path";
import fs from "fs";
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
export default defineConfig({
shortcuts: [
[
"icon-btn",
"inline-block cursor-pointer select-none opacity-75 scale-155 transition duration-200 ease-in-out hover:opacity-100 hover:text-teal-600",
],
["card-grid", "grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-3 gap-8"],
],
presets: [
presetUno(),
presetAttributify(),
presetTypography(),
presetIcons({
scale: 1.2,
warn: true,
collections: {
custom: getCustomIcons(),
},
}),
],
theme: {
colors: {
primary: "var(--vp-c-brand)",
},
},
transformers: [transformerDirectives(), transformerVariantGroup()],
safelist: "prose prose-sm m-auto text-left".split(" "),
});
function getCustomIcons() {
const data = {};
fs.readdirSync(resolve(__dirname, "./src/public/imgs/svg")).forEach((val) => {
data[val.replace(".svg", "")] = fs.readFileSync(
resolve(__dirname, "./src/public/imgs/svg/" + val),
"utf8",
);
});
return data;
}