summaryrefslogtreecommitdiffhomepage
path: root/packages/desktop
diff options
context:
space:
mode:
authorAdam <[email protected]>2025-12-28 06:41:54 -0600
committerAdam <[email protected]>2025-12-28 06:41:59 -0600
commit82a876da4de0074ca3d4d6af9a31dc6e8cf20c3a (patch)
treee83d71404c832ff59b351540f4a56eecf2b97b36 /packages/desktop
parent69a15ae9c1e6737728649cebf3a4009d9ae8edd3 (diff)
downloadopencode-82a876da4de0074ca3d4d6af9a31dc6e8cf20c3a.tar.gz
opencode-82a876da4de0074ca3d4d6af9a31dc6e8cf20c3a.zip
chore: cleanup
Diffstat (limited to 'packages/desktop')
-rw-r--r--packages/desktop/index.html31
1 files changed, 29 insertions, 2 deletions
diff --git a/packages/desktop/index.html b/packages/desktop/index.html
index ea656068c..83826b602 100644
--- a/packages/desktop/index.html
+++ b/packages/desktop/index.html
@@ -13,9 +13,36 @@
<meta name="theme-color" content="#131010" media="(prefers-color-scheme: dark)" />
<meta property="og:image" content="/social-share.png" />
<meta property="twitter:image" content="/social-share.png" />
- <!-- Theme preload script - injected by Vite plugin to avoid FOUC -->
+ <!-- Theme preload script - applies cached theme to avoid FOUC -->
<script id="oc-theme-preload-script">
- /* THEME_PRELOAD_SCRIPT */
+ ;(function () {
+ var themeId = localStorage.getItem("opencode-theme-id")
+ if (!themeId) return
+
+ var scheme = localStorage.getItem("opencode-color-scheme") || "system"
+ var isDark = scheme === "dark" || (scheme === "system" && matchMedia("(prefers-color-scheme: dark)").matches)
+ var mode = isDark ? "dark" : "light"
+
+ document.documentElement.dataset.theme = themeId
+ document.documentElement.dataset.colorScheme = mode
+
+ if (themeId === "oc-1") return
+
+ var css = localStorage.getItem("opencode-theme-css-" + themeId + "-" + mode)
+ if (css) {
+ var style = document.createElement("style")
+ style.id = "oc-theme-preload"
+ style.textContent =
+ ":root{color-scheme:" +
+ mode +
+ ";--text-mix-blend-mode:" +
+ (isDark ? "plus-lighter" : "multiply") +
+ ";" +
+ css +
+ "}"
+ document.head.appendChild(style)
+ }
+ })()
</script>
</head>
<body class="antialiased overscroll-none text-12-regular overflow-hidden">