2024-09-26 11:30:21 +08:00
|
|
|
import { defineConfig, presetIcons, presetUno, transformerDirectives, transformerVariantGroup } from "unocss"
|
2024-10-12 12:49:20 +08:00
|
|
|
import { colors } from "./shared/colors"
|
2024-09-26 11:30:21 +08:00
|
|
|
|
|
|
|
export default defineConfig({
|
|
|
|
mergeSelectors: false,
|
|
|
|
transformers: [transformerDirectives(), transformerVariantGroup()],
|
|
|
|
presets: [
|
|
|
|
presetUno(),
|
|
|
|
presetIcons({
|
|
|
|
scale: 1.2,
|
|
|
|
}),
|
|
|
|
],
|
|
|
|
rules: [],
|
|
|
|
shortcuts: {
|
|
|
|
"color-base": "color-neutral-800 dark:color-neutral-300",
|
2024-10-12 15:50:44 +08:00
|
|
|
"bg-base": "bg-white dark:bg-dark-600",
|
2024-10-11 18:47:27 +08:00
|
|
|
"shadow-base": "shadow-[0px_2px_3px_-1px_rgba(0,0,0,0.1),0px_1px_0px_0px_rgba(25,28,33,0.02),0px_0px_0px_1px_rgba(25,28,33,0.08)] dark:shadow-[0px_2px_3px_-1px_rgba(0,0,0,0.1),0px_1px_0px_0px_rgba(25,28,33,0.02),0px_0px_0px_1px_rgba(25,28,33,0.08)]",
|
2024-09-26 11:30:21 +08:00
|
|
|
|
2024-10-12 15:50:44 +08:00
|
|
|
"bg-hover": "bg-primary-400/5",
|
2024-09-26 11:30:21 +08:00
|
|
|
|
|
|
|
"color-active": "color-primary-600 dark:color-primary-400",
|
|
|
|
"border-active": "border-primary-600/25 dark:border-primary-400/25",
|
2024-10-12 15:50:44 +08:00
|
|
|
"bg-active": "bg-primary-400/10",
|
2024-09-26 11:30:21 +08:00
|
|
|
|
2024-10-11 18:47:27 +08:00
|
|
|
"btn-pure": "op50 hover:op75",
|
2024-09-26 11:30:21 +08:00
|
|
|
"btn-action": "border border-base rounded flex gap-2 items-center px2 py1 op75 hover:op100 hover:bg-hover",
|
|
|
|
"btn-action-active": "color-active border-active! bg-active op100!",
|
|
|
|
},
|
2024-10-12 12:49:20 +08:00
|
|
|
safelist: [
|
2024-10-12 15:50:44 +08:00
|
|
|
...["bg", "color", "border"].map(t => colors.map(c => `${t}-${c}`)).flat(1),
|
2024-10-12 12:49:20 +08:00
|
|
|
],
|
|
|
|
extendTheme: (theme) => {
|
|
|
|
// @ts-expect-error >_<
|
|
|
|
theme.colors.primary = theme.colors.red
|
|
|
|
return theme
|
2024-09-26 11:30:21 +08:00
|
|
|
},
|
|
|
|
})
|