1 Star 0 Fork 0

CheriSh_Meng/vite5-vue3-ts-demo

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
uno.config.ts 2.58 KB
一键复制 编辑 原始数据 按行查看 历史
Lei Liu 提交于 2024-08-22 18:07 +08:00 . [add] 提交代码,当前进度可看md
import {
defineConfig,
presetUno, // UnoCSS 的默认预设。目前相当于 @unocss/preset-wind https://unocss.nodejs.cn/presets/uno (rules: https://github.com/unocss/unocss/blob/main/packages/preset-mini/src/_rules)
presetAttributify, // 属性化预设
// presetIcons, // 对 UnoCSS 使用纯 CSS 的任何图标
transformerDirectives // 适用于 @apply、@screen 和 theme() 指令的 UnoCSS 转换器:@unocss/transformer-directives
} from 'unocss'
export default defineConfig({
// ...UnoCSS options
presets: [presetUno(), presetAttributify()],
transformers: [transformerDirectives()],
shortcuts: {
'f-b': 'flex justify-between items-center',
'f-c': 'flex justify-center items-center',
'f-s': 'flex justify-start items-center',
'f-e': 'flex justify-end items-center',
'text-overflow': 'truncate',
'wh-full': 'w-full h-full'
},
rules: [
[/^b-(\d+)$/, (match) => ({ 'border-width': `${match[1]}px` })],
[/^b-(\d+)-#([\w]+)$/, (match) => ({ border: `solid ${match[1]}px #${match[2]}` })],
[/^bt-(\d+)-#([\w]+)$/, (match) => ({ 'border-top': `solid ${match[1]}px #${match[2]}` })],
[/^bb-(\d+)-#([\w]+)$/, (match) => ({ 'border-bottom': `solid ${match[1]}px #${match[2]}` })],
[/^bl-(\d+)-#([\w]+)$/, (match) => ({ 'border-left': `solid ${match[1]}px #${match[2]}` })],
[/^br-(\d+)-#([\w]+)$/, (match) => ({ 'border-right': `solid ${match[1]}px #${match[2]}` })],
[/^px-(\d+)$/, (match) => ({ 'padding-left': `${match[1]}px`, 'padding-right': `${match[1]}px` })],
[/^py-(\d+)$/, (match) => ({ 'padding-top': `${match[1]}px`, 'padding-bottom': `${match[1]}px` })],
[/^mx-(\d+)$/, (match) => ({ 'margin-left': `${match[1]}px`, 'margin-right': `${match[1]}px` })],
[/^my-(\d+)$/, (match) => ({ 'margin-top': `${match[1]}px`, 'margin-bottom': `${match[1]}px` })],
[/^pt-(\d+)$/, (match) => ({ 'padding-top': `${match[1]}px` })],
[/^pb-(\d+)$/, (match) => ({ 'padding-bottom': `${match[1]}px` })],
[/^pl-(\d+)$/, (match) => ({ 'padding-left': `${match[1]}px` })],
[/^pr-(\d+)$/, (match) => ({ 'padding-right': `${match[1]}px` })],
[/^mt-(\d+)$/, (match) => ({ 'margin-top': `${match[1]}px` })],
[/^mb-(\d+)$/, (match) => ({ 'margin-bottom': `${match[1]}px` })],
[/^ml-(\d+)$/, (match) => ({ 'margin-left': `${match[1]}px` })],
[/^mr-(\d+)$/, (match) => ({ 'margin-right': `${match[1]}px` })]
// [
// /^bgimage-(\w+)-(.+)-(svg|png|jpg|gif)$/,
// ([, dir, fname, fext]) => {
// return {
// 'background-image': `url(@/assets/${dir}/${fname}.${fext})`
// }
// }
// ]
]
})
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/pingm/vite5-vue3-ts-demovvvv.git
git@gitee.com:pingm/vite5-vue3-ts-demovvvv.git
pingm
vite5-vue3-ts-demovvvv
vite5-vue3-ts-demo
master

搜索帮助