From 0762e7bb3dba34ccd41fce3566ffd9f51a1fe957 Mon Sep 17 00:00:00 2001 From: obroccolio Date: Fri, 7 Aug 2026 15:32:38 +0800 Subject: [PATCH] feat: sync theme background tokens --- src/components/ThemedPageMeta/index.tsx | 2 +- src/hooks/useStatusBar.ts | 2 +- src/utils/themeBackground.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/ThemedPageMeta/index.tsx b/src/components/ThemedPageMeta/index.tsx index 496e53e..872455f 100644 --- a/src/components/ThemedPageMeta/index.tsx +++ b/src/components/ThemedPageMeta/index.tsx @@ -9,7 +9,7 @@ interface ThemedPageMetaProps { export default function ThemedPageMeta({ darkTop = false }: ThemedPageMetaProps) { const { resolvedTheme } = useThemeContext() const isDark = resolvedTheme === 'dark' || darkTop - const bg = isDark ? '#191919' : '#ffffff' + const bg = isDark ? '#191919' : '#faf7f2' const frontColor = isDark ? '#ffffff' : '#000000' return ( diff --git a/src/hooks/useStatusBar.ts b/src/hooks/useStatusBar.ts index 0ce8e2e..11bf8db 100644 --- a/src/hooks/useStatusBar.ts +++ b/src/hooks/useStatusBar.ts @@ -21,7 +21,7 @@ export function useStatusBar(resolvedTheme: 'light' | 'dark', options: UseStatus const apply = useCallback(() => { const isDarkText = mode === 'dark' || (mode === 'auto' && resolvedTheme === 'light') const frontColor = isDarkText ? '#000000' : '#ffffff' - const bgColor = isDarkText ? '#ffffff' : '#191919' + const bgColor = isDarkText ? '#faf7f2' : '#191919' Taro.setNavigationBarColor({ frontColor, backgroundColor: bgColor }) // 同步页面背景色,确保自定义导航区(状态栏下方、胶囊按钮区域)跟随主题, diff --git a/src/utils/themeBackground.ts b/src/utils/themeBackground.ts index 9f1af91..736065f 100644 --- a/src/utils/themeBackground.ts +++ b/src/utils/themeBackground.ts @@ -2,7 +2,7 @@ import Taro from '@tarojs/taro' /** 实际生效主题对应的窗口/页面背景色 */ export function themePageColor(theme: 'light' | 'dark'): string { - return theme === 'dark' ? '#191919' : '#ffffff' + return theme === 'dark' ? '#191919' : '#faf7f2' } /**