fix(theme): 修复浅色主题下大神昵称白底白字及标签对比度过低问题,消除黑底黑字与样式失效缺陷
这个提交包含在:
@@ -113,6 +113,25 @@ export function applyThemeToNativeUI(themeKey) {
|
||||
} catch (e) {
|
||||
// 忽略非 TabBar 页面抛出的异常
|
||||
}
|
||||
|
||||
// 3. 在 H5 环境下同步在 body 与 documentElement 上添加/移除主题 class,并同步设置 CSS 变量
|
||||
try {
|
||||
if (typeof document !== 'undefined') {
|
||||
if (themeKey === THEME_KEYS.WARM) {
|
||||
document.body.classList.add('theme-warm');
|
||||
document.documentElement.classList.add('theme-warm');
|
||||
document.documentElement.style.setProperty('--nav-bg', navBar.backgroundColor);
|
||||
document.documentElement.style.setProperty('--nav-color', navBar.frontColor === '#000000' ? '#1C1917' : '#FFFFFF');
|
||||
} else {
|
||||
document.body.classList.remove('theme-warm');
|
||||
document.documentElement.classList.remove('theme-warm');
|
||||
document.documentElement.style.setProperty('--nav-bg', navBar.backgroundColor);
|
||||
document.documentElement.style.setProperty('--nav-color', '#F8FAFC');
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
// 忽略特定平台无 DOM 对象异常
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
在新工单中引用
屏蔽一个用户