diff --git a/src/types/components.d.ts b/src/types/components.d.ts new file mode 100644 index 0000000..b23ba0d --- /dev/null +++ b/src/types/components.d.ts @@ -0,0 +1,12 @@ +/* eslint-disable */ +/* prettier-ignore */ +// @ts-nocheck +// Generated by vite-plugin-uni-components +// Read more: https://github.com/vuejs/core/pull/3399 +export {} + +declare module 'vue' { + export interface GlobalComponents { + FgNavbar: typeof import('./../components/fg-navbar/fg-navbar.vue')['default'] + } +} diff --git a/uno.config.ts b/uno.config.ts index 58f8cb3..6a98766 100644 --- a/uno.config.ts +++ b/uno.config.ts @@ -13,5 +13,38 @@ export default defineConfig({ }, }), ], - transformers: [transformerDirectives(), transformerVariantGroup()], + transformers: [ + // 启用指令功能:主要用于支持 @apply、@screen 和 theme() 等 CSS 指令 + transformerDirectives(), + // 启用 () 分组功能 + // 支持css class组合,eg: `
测试 unocss
` + transformerVariantGroup(), + ], + shortcuts: [ + { + center: 'flex justify-center items-center', + }, + ], + rules: [ + [ + 'p-safe', + { + padding: + 'env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)', + }, + ], + ['pt-safe', { 'padding-top': 'env(safe-area-inset-top)' }], + ['pb-safe', { 'padding-bottom': 'env(safe-area-inset-bottom)' }], + ], + theme: { + colors: { + /** 主题色,用法如: text-primary */ + primary: 'var(--wot-color-theme,#0957DE)', + }, + fontSize: { + /** 提供更小号的字体,用法如:text-2xs */ + '2xs': ['20rpx', '28rpx'], + '3xs': ['18rpx', '26rpx'], + }, + }, })