From 1fb32e759ca9f447d40d1d049f6972aa3cd5625b Mon Sep 17 00:00:00 2001 From: Eli Kinsey Date: Mon, 27 Oct 2025 12:24:54 -0700 Subject: [PATCH] set initial theme (#13411) --- src/context/App.tsx | 4 ++-- static/scripts/theme-init.js | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/context/App.tsx b/src/context/App.tsx index e43a27ab6..77001116c 100644 --- a/src/context/App.tsx +++ b/src/context/App.tsx @@ -981,8 +981,8 @@ const isLabel = (item: any) => !item?.url && item?.name const getInitialSiteSettings = (isMobile: boolean, compact: boolean) => { const siteSettings = { experience: 'posthog', - colorMode: 'light', - theme: 'light', + colorMode: (typeof window !== 'undefined' && (window as any).__theme) || 'light', + theme: (typeof window !== 'undefined' && (window as any).__theme) || 'light', skinMode: 'modern', cursor: 'default', wallpaper: 'keyboard-garden', diff --git a/static/scripts/theme-init.js b/static/scripts/theme-init.js index 4f383a7de..ad4391a89 100644 --- a/static/scripts/theme-init.js +++ b/static/scripts/theme-init.js @@ -7,7 +7,6 @@ window.__onThemeChange(newTheme) } var preferredTheme - var slug = window.location.pathname.substring(1) var darkQuery = window.matchMedia('(prefers-color-scheme: dark)') darkQuery.addListener(function (e) { if (!localStorage.getItem('theme')) {