feat(style): 前台强制切换浅色主题,保护后台管理页暗色
- variables.css: 新增 body[data-frontend]:not(.admin-body) 作用域浅色系变量 包含 --accent-purple/pink/blue 三色花点缀色,圆角上限 8px 硬边设计 - theme-protection.css: 前台页面及表单控件强制 color-scheme: light - default.vue: onMounted 时为 body 注入 data-frontend=true 标记 - dashboard.vue: 根容器添加 admin-body class,阻断前台浅色变量污染
This commit is contained in:
@@ -13,8 +13,10 @@ import { SpeedInsights } from '@vercel/speed-insights/nuxt'
|
||||
|
||||
const { initSiteConfig } = useSiteConfig()
|
||||
|
||||
// 初始化站点配置
|
||||
onMounted(() => {
|
||||
if (typeof document !== 'undefined' && document.body) {
|
||||
document.body.setAttribute('data-frontend', 'true')
|
||||
}
|
||||
initSiteConfig()
|
||||
})
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user