fix: force theme via inline style as ultimate fallback
CI / lint (push) Successful in 23s
CI / security (push) Successful in 13s
CI / test (push) Successful in 32s
CI / build (push) Successful in 7s
CI / e2e (push) Failing after 15s

- Added <style id='theme-force'> with !important dark theme defaults
- JS updates inline style for light mode
- Completely bypasses CSS variable loading, caching, or path issues
- Guarantees body bg/text color regardless of stylesheet state
This commit is contained in:
2026-07-24 15:01:04 -04:00
parent a583281edb
commit 02396641f6
+8 -1
View File
@@ -4,13 +4,20 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ObsiGate - Popout</title>
<style id="theme-force">
/* Forced by inline script — bypasses any CSS loading issues */
html, body { background: #0f1117 !important; color: #e6edf3 !important; }
</style>
<script>
// 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); }
// Force background/text as backup regardless of CSS variable loading
if (theme === 'light') {
document.getElementById('theme-force').textContent = 'html, body { background: #ffffff !important; color: #1a1a1a !important; }';
}
})();
</script>
<link rel="stylesheet" href="/static/style.css?v=2">