2024-01-10 02:18:32 +08:00
|
|
|
import { defineConfig } from '@unocss/vite'
|
|
|
|
import presetUno from '@unocss/preset-uno'
|
2024-04-19 15:59:26 +08:00
|
|
|
import transformerDirectives from '@unocss/transformer-directives' // 设置指令
|
|
|
|
import transformerVariantGroup from '@unocss/transformer-variant-group' // 解决繁琐的多次写前缀的情况
|
2024-01-10 02:18:32 +08:00
|
|
|
|
|
|
|
export default defineConfig({
|
|
|
|
content: {
|
|
|
|
pipeline: {
|
2024-01-18 08:56:53 +08:00
|
|
|
exclude: ['node_modules', 'dist', '.git', '.vscode', 'public', 'build', 'config', 'src-tauri']
|
2024-01-10 02:18:32 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
presets: [presetUno({ dark: 'class' })],
|
2024-04-19 15:59:26 +08:00
|
|
|
transformers: [transformerDirectives(), transformerVariantGroup()],
|
2024-07-16 17:37:25 +08:00
|
|
|
/** 自定义规则 */
|
|
|
|
rules: [
|
|
|
|
[
|
|
|
|
/^custom-shadow$/,
|
|
|
|
() => ({
|
|
|
|
'box-shadow': 'var(--shadow-enabled) 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)'
|
|
|
|
})
|
|
|
|
]
|
|
|
|
],
|
2024-01-10 02:18:32 +08:00
|
|
|
/**
|
|
|
|
* 快捷键命名标准
|
|
|
|
* @default '布局样式 - 水平样式 - 垂直样式'
|
|
|
|
*/
|
|
|
|
shortcuts: {
|
|
|
|
'flex-center': 'flex justify-center items-center',
|
2024-10-10 14:38:04 +08:00
|
|
|
'flex-end-center': 'flex justify-end items-center',
|
2024-01-10 02:18:32 +08:00
|
|
|
'flex-start-center': 'flex justify-start items-center',
|
|
|
|
'flex-between-center': 'flex justify-between items-center',
|
|
|
|
'flex-around-center': 'flex justify-around items-center',
|
2024-10-10 14:38:04 +08:00
|
|
|
'flex-evenly-center': 'flex justify-evenly items-center',
|
2024-01-10 02:18:32 +08:00
|
|
|
'flex-col-center': 'flex-center flex-col',
|
2024-01-21 09:59:18 +08:00
|
|
|
'flex-col-x-center': 'flex flex-col items-center',
|
|
|
|
'flex-col-y-center': 'flex flex-col justify-center',
|
2024-01-10 02:18:32 +08:00
|
|
|
'flex-x-center': 'flex justify-center',
|
|
|
|
'flex-y-center': 'flex items-center',
|
2024-09-01 21:40:14 +08:00
|
|
|
'absolute-center': 'absolute left-1/2 top-1/2 transform -translate-x-1/2 -translate-y-1/2',
|
2024-10-10 14:38:04 +08:00
|
|
|
'absolute-flex-center': 'absolute flex-center left-1/2 top-1/2 transform -translate-x-1/2 -translate-y-1/2',
|
2024-01-10 02:18:32 +08:00
|
|
|
'absolute-lt': 'absolute left-0 top-0',
|
|
|
|
'absolute-lb': 'absolute left-0 bottom-0',
|
|
|
|
'absolute-rt': 'absolute right-0 top-0',
|
|
|
|
'absolute-rb': 'absolute right-0 bottom-0',
|
2024-06-12 01:16:01 +08:00
|
|
|
'absolute-x-center': 'absolute-lt flex-x-center size-full',
|
|
|
|
'absolute-y-center': 'absolute-lt flex-y-center size-full',
|
2024-01-10 02:18:32 +08:00
|
|
|
'fixed-lt': 'fixed left-0 top-0',
|
|
|
|
'fixed-lb': 'fixed left-0 bottom-0',
|
|
|
|
'fixed-rt': 'fixed right-0 top-0',
|
|
|
|
'fixed-rb': 'fixed right-0 bottom-0',
|
2024-03-28 23:58:24 +08:00
|
|
|
'fixed-center': 'fixed-lt flex-center size-full'
|
2024-01-10 02:18:32 +08:00
|
|
|
}
|
|
|
|
})
|