-
Notifications
You must be signed in to change notification settings - Fork 1
/
unocss.config.ts
73 lines (71 loc) · 2.43 KB
/
unocss.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
import {
defineConfig,
presetIcons,
presetTypography,
presetUno,
transformerCompileClass,
transformerDirectives,
transformerVariantGroup,
} from "unocss";
import { presetGrid } from "./lib/unocss-preset-grid";
import { createColorScaleGenerator } from "./scripts/color-scales-generate";
import transformerMultiStateValues from "./lib/unocss-multi-state-values";
const generateColorScale = createColorScaleGenerator(
// (value) => `hsl(${value} / <alpha-value>)`
(value) => `hsl(${value})`
);
export default defineConfig({
// safelist: [...unoFiles.flatMap((data) => data.safelist ?? [])],
safelist: [],
shortcuts: [
["out-1", "outline outline-1"],
["pressable-opacity", "transition cursor-pointer hover:(opacity-60) active:(opacity-45)"],
["pressable-tonal", "transition cursor-pointer bg-neutral-3 hover:bg-neutral-4 active:bg-neutral-5"],
["card", "rounded out-1 outline-neutral-6 bg-neutral-2"],
["card-pressable", "transition cursor-pointer hover:bg-neutral-3 active:bg-neutral-4"],
["h-square", "before:(content-none pt-full float-left) after:(content-none block clear-both)"],
],
rules: [
[/^bg@([\w-]+)$/, ([, name]) => ({ "background-color": `var(--h-color-${name})` })],
[/^text@([\w-]+)$/, ([, name]) => ({ color: `var(--h-color-${name})` })],
[/^border@([\w-]+)$/, ([, name]) => ({ "border-color": `var(--h-color-${name})` })],
[/^outline@([\w-]+)$/, ([, name]) => ({ "outline-color": `var(--h-color-${name})` })],
],
presets: [presetGrid(), presetUno(), presetTypography()], //Container는 PresetUno 걸 이용할 것이므로 순서 유의!
theme: {
colors: {
transprent: "transparent",
current: "currentColor",
primary: { ...generateColorScale("orange") },
neutral: { ...generateColorScale("sand") },
},
container: {
center: true,
padding: {
sm: "16px",
md: "16px",
lg: "24px",
},
},
breakpoints: {
sm: "672px", //640px
md: "800px", //768px
lg: "1176px", //1128px
},
},
transformers: [
// transformerMultiStateValues({
// brackets: ["{{", "}}"],
// split: ' ',
// variants: [null, "hover", "active", "focus"],
// }),
// transformerMultiStateValues({
// brackets: ["@media{", "}"],
// split: ',',
// variants: [null, "lt-md", "md"],
// }),
transformerCompileClass(),
transformerVariantGroup(),
transformerDirectives(),
],
});