fix: force theme via inline style as ultimate fallback
- 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:
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user