From 170936a96ef9b59ac8a95d0201c34ef6d9438644 Mon Sep 17 00:00:00 2001 From: Yorun <547747006@qq.com> Date: Fri, 12 May 2023 18:47:41 +0800 Subject: [PATCH] fix: the theme-color selector --- app/components/home.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/components/home.tsx b/app/components/home.tsx index 4c3d0a646..6b34a5a1b 100644 --- a/app/components/home.tsx +++ b/app/components/home.tsx @@ -64,17 +64,17 @@ export function useSwitchTheme() { } const metaDescriptionDark = document.querySelector( - 'meta[name="theme-color"][media]', + 'meta[name="theme-color"][media*="dark"]', ); const metaDescriptionLight = document.querySelector( - 'meta[name="theme-color"]:not([media])', + 'meta[name="theme-color"][media*="light"]', ); if (config.theme === "auto") { metaDescriptionDark?.setAttribute("content", "#151515"); metaDescriptionLight?.setAttribute("content", "#fafafa"); } else { - const themeColor = getCSSVar("--themeColor"); + const themeColor = getCSSVar("--theme-color"); metaDescriptionDark?.setAttribute("content", themeColor); metaDescriptionLight?.setAttribute("content", themeColor); }