feat(theme): 移除首页主题切换按钮,恢复默认深色主题 ClassicDark
- 首页 index.vue:删除主题切换按钮 DOM、useTheme 引入及 handleToggleTheme 处理函数 - nuxt.config.ts:defaultTheme ClassicLight → ClassicDark;enabledThemes 恢复为 4 主题(System/ClassicDark/ClassicLight/ModernLight);x-default-theme meta 和防闪烁脚本回退值同步改为 ClassicDark - schema.ts / system-settings-defaults / site-config API / POST API / useSiteConfig:7 处主题默认配置全部从 ClassicLight/双浅色列表 同步改为 ClassicDark/四主题完整列表
This commit is contained in:
+4
-4
@@ -156,8 +156,8 @@ export default defineNuxtConfig({
|
||||
themeColor: process.env.PWA_THEME_COLOR || '#111111'
|
||||
},
|
||||
// 主题配置
|
||||
defaultTheme: process.env.NUXT_PUBLIC_DEFAULT_THEME || 'ClassicLight',
|
||||
enabledThemes: (process.env.NUXT_PUBLIC_ENABLED_THEMES || 'ClassicLight,ModernLight')
|
||||
defaultTheme: process.env.NUXT_PUBLIC_DEFAULT_THEME || 'ClassicDark',
|
||||
enabledThemes: (process.env.NUXT_PUBLIC_ENABLED_THEMES || 'System,ClassicDark,ClassicLight,ModernLight')
|
||||
.split(',')
|
||||
.map((s) => s.trim())
|
||||
.filter(Boolean),
|
||||
@@ -192,7 +192,7 @@ export default defineNuxtConfig({
|
||||
{ name: 'theme-color', content: '#111111' },
|
||||
{
|
||||
name: 'x-default-theme',
|
||||
content: process.env.NUXT_PUBLIC_DEFAULT_THEME || 'ClassicLight'
|
||||
content: process.env.NUXT_PUBLIC_DEFAULT_THEME || 'ClassicDark'
|
||||
},
|
||||
{ name: 'apple-mobile-web-app-capable', content: 'yes' },
|
||||
{ name: 'apple-mobile-web-app-status-bar-style', content: 'black-translucent' },
|
||||
@@ -213,7 +213,7 @@ export default defineNuxtConfig({
|
||||
` var meta=document.querySelector('meta[name="x-default-theme"]');`,
|
||||
` if(meta && meta.content){s=meta.content}`,
|
||||
` }catch(e){s=null}`,
|
||||
` if(!s){s='ClassicLight'}`,
|
||||
` if(!s){s='ClassicDark'}`,
|
||||
` }`,
|
||||
` if(s==='System'||s==='system'){eff=window.matchMedia('(prefers-color-scheme: dark)').matches?'dark':'light'}`,
|
||||
` else if(typeof s==='string'){eff=s.endsWith('Dark')||s==='dark'?'dark':(s.endsWith('Light')||s==='light'?'light':s)}`,
|
||||
|
||||
Reference in New Issue
Block a user