diff --git a/.github/nuxt.config.ts b/.github/nuxt.config.ts index 2752888..b780a3b 100644 --- a/.github/nuxt.config.ts +++ b/.github/nuxt.config.ts @@ -1,11 +1,10 @@ -import { dirname, join } from 'node:path'; -import { fileURLToPath } from 'node:url'; -import tailwindcss from '@tailwindcss/vite'; +import { dirname, join } from 'node:path' +import { fileURLToPath } from 'node:url' +import tailwindcss from '@tailwindcss/vite' -const currentDir = dirname(fileURLToPath(import.meta.url)); +const currentDir = dirname(fileURLToPath(import.meta.url)) export default defineNuxtConfig({ - devtools: { enabled: true }, modules: [ 'shadcn-nuxt', '@vueuse/nuxt', @@ -16,42 +15,33 @@ export default defineNuxtConfig({ 'nuxt-og-image', '@nuxt/scripts', '@nuxtjs/i18n', - '@nuxt/fonts', + '@nuxt/fonts' ], - shadcn: { - prefix: 'Ui', - componentDir: join(currentDir, './components/ui'), - }, components: { dirs: [ { path: './components', - ignore: ['**/*.ts'], - }, - ], - }, - i18n: { - bundle: { - optimizeTranslationDirective: false, - }, - strategy: 'prefix_except_default', - }, - colorMode: { - classSuffix: '', - disableTransition: true, + ignore: ['**/*.ts'] + } + ] }, + devtools: { enabled: true }, css: [ join(currentDir, './assets/css/themes.css'), - '~/assets/css/tailwind.css', + '~/assets/css/tailwind.css' ], + colorMode: { + classSuffix: '', + disableTransition: true + }, content: { documentDriven: true, highlight: { theme: { default: 'github-light', - dark: 'github-dark', + dark: 'github-dark' }, - preload: ['json', 'js', 'ts', 'html', 'css', 'vue', 'diff', 'shell', 'markdown', 'mdc', 'yaml', 'bash', 'ini', 'dotenv'], + preload: ['json', 'js', 'ts', 'html', 'css', 'vue', 'diff', 'shell', 'markdown', 'mdc', 'yaml', 'bash', 'ini', 'dotenv'] }, navigation: { fields: [ @@ -65,40 +55,50 @@ export default defineNuxtConfig({ 'editLink', 'prevNext', 'breadcrumb', - 'fullpage', - ], + 'fullpage' + ] }, experimental: { search: { - indexed: true, - }, - }, + indexed: true + } + } }, - icon: { - clientBundle: { - scan: true, - sizeLimitKb: 512, - }, - }, - fonts: { - defaults: { - weights: ['300 800'], - }, + compatibilityDate: '2025-05-13', + vite: { + plugins: [ + tailwindcss() + ], + optimizeDeps: { + include: ['debug'] + } }, typescript: { tsConfig: { compilerOptions: { - baseUrl: '.', - }, - }, + baseUrl: '.' + } + } }, - vite: { - plugins: [ - tailwindcss(), - ], - optimizeDeps: { - include: ['debug'], - }, + fonts: { + defaults: { + weights: ['300 800'] + } }, - compatibilityDate: '2025-05-13', -}); + i18n: { + bundle: { + optimizeTranslationDirective: false + }, + strategy: 'prefix_except_default' + }, + icon: { + clientBundle: { + scan: true, + sizeLimitKb: 512 + } + }, + shadcn: { + prefix: 'Ui', + componentDir: join(currentDir, './components/ui') + } +}) diff --git a/app/app.vue b/app/app.vue index 097d108..147a155 100644 --- a/app/app.vue +++ b/app/app.vue @@ -12,16 +12,16 @@ const { selectedTheme, selectedFont, selectedFontSize } = useTheme() // 计算根元素的 CSS 类 const rootClasses = computed(() => { const classes = [] - + // 添加主题类 classes.push(`theme-${selectedTheme.value}`) - + // 添加字体类 classes.push(`font-${selectedFont.value}`) - + // 移除字号类,让它在具体组件中处理 // classes.push(`text-${selectedFontSize.value}`) - + return classes.join(' ') }) @@ -65,4 +65,3 @@ provide('navigation', navigation) - diff --git a/app/components/AppHeader.vue b/app/components/AppHeader.vue index d62a4d6..d8f647d 100644 --- a/app/components/AppHeader.vue +++ b/app/components/AppHeader.vue @@ -1,66 +1,93 @@