fix: popout theme inheritance via URL query param
CI / lint (push) Successful in 24s
CI / security (push) Successful in 14s
CI / test (push) Successful in 28s
CI / build (push) Successful in 18s
CI / e2e (push) Failing after 10s

- Pass current theme as ?theme=dark|light in popout URL
- viewer.js, app.js, palette.js all pass theme to popout
- popout.html reads theme from URL param first (fallback: localStorage, then dark)
- Also syncs theme back to localStorage when set via query param
This commit is contained in:
2026-07-24 14:56:29 -04:00
parent f3bfd01f93
commit a1355977d9
4 changed files with 12 additions and 4 deletions
+7 -1
View File
@@ -5,7 +5,13 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ObsiGate - Popout</title>
<script>
document.documentElement.setAttribute('data-theme', localStorage.getItem('obsigate-theme') || 'dark');
// Inherit theme from opener or localStorage — query param has priority
(function() {
var m = location.search.match(/theme=([^&]+)/);
var theme = (m && m[1]) || localStorage.getItem('obsigate-theme') || 'dark';
document.documentElement.setAttribute('data-theme', theme);
if (m && m[1]) { localStorage.setItem('obsigate-theme', theme); }
})();
</script>
<link rel="stylesheet" href="/static/style.css">
<script src="https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.min.js"></script>