mirror of
https://github.com/fantastic-admin/basic.git
synced 2026-10-07 13:07:58 +08:00
feat: 扩充 unocss 自定义 shortcuts
This commit is contained in:
+19
-4
@@ -22,10 +22,25 @@ export default defineConfig<Theme>({
|
||||
},
|
||||
},
|
||||
shortcuts: [
|
||||
{
|
||||
'flex-center': 'flex justify-center items-center',
|
||||
'flex-col-center': 'flex flex-col justify-center items-center',
|
||||
},
|
||||
[/^flex-?(col)?-(start|end|center|baseline|stretch)-?(start|end|center|between|around|evenly|left|right)?$/, ([, col, items, justify]) => {
|
||||
const cls = ['flex']
|
||||
if (col === 'col') {
|
||||
cls.push('flex-col')
|
||||
}
|
||||
if (items === 'center' && !justify) {
|
||||
cls.push('items-center')
|
||||
cls.push('justify-center')
|
||||
}
|
||||
else {
|
||||
cls.push(`items-${items}`)
|
||||
if (justify) {
|
||||
cls.push(`justify-${justify}`)
|
||||
}
|
||||
}
|
||||
return cls.join(' ')
|
||||
}],
|
||||
[/^square-\[?(.*?)\]?$/, ([, size]) => `w-${size} h-${size}`],
|
||||
[/^circle-\[?(.*?)\]?$/, ([, size]) => `square-${size} rounded-full`],
|
||||
],
|
||||
preflights: [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user