From 42df29979144264caf91d97e6b903870d3d73f63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=88=AA=E5=AE=87?= <3364451258@qq.com> Date: Thu, 6 Aug 2026 22:49:03 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=87=8D=E5=86=99=E6=9A=97=E8=89=B2?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E8=A6=86=E7=9B=96=EF=BC=8C=E5=9F=BA=E4=BA=8E?= =?UTF-8?q?=E7=9C=9F=E5=AE=9E=20DOM=20=E7=B1=BB=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 问题: 之前的 CSS 覆盖使用推测的 Tailwind/Vuetify 类名, 但 Halo 2.25 实际使用 UnoCSS + BEM 语义类, 导致大部分 页面元素未切换颜色。 修复: - 新增 halo-core.css, 覆盖真实类名: .page-header, .card-wrapper, .entity-field-title, .pagination, .tag-default, .modal-*, .description-item-*, .toast-container, .markdown-body, html/body 根背景 - 新增 injector.ts, 通过 MutationObserver 将 ThemeToggle 挂载到侧边栏 .sidebar__profile 上方 - 基于 demo.halocms.site 真实环境扫描验证 9 个页面 零白色残留、零不可见文字 Co-Authored-By: Claude Opus 4.8 --- ui/src/components/ThemeToggle.vue | 7 +- ui/src/index.ts | 8 +- ui/src/injector.ts | 46 +++++ ui/src/styles/index.css | 1 + ui/src/styles/overrides/halo-core.css | 272 ++++++++++++++++++++++++++ 5 files changed, 329 insertions(+), 5 deletions(-) create mode 100644 ui/src/injector.ts create mode 100644 ui/src/styles/overrides/halo-core.css diff --git a/ui/src/components/ThemeToggle.vue b/ui/src/components/ThemeToggle.vue index e05d6d6..215fa6f 100644 --- a/ui/src/components/ThemeToggle.vue +++ b/ui/src/components/ThemeToggle.vue @@ -1,5 +1,6 @@