File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22 Design System & Variables
33 ========================================================================= */
44: root {
5+ color-scheme : dark;
56 /* Color Palette */
67 --bg-base : # 0a0a0f ;
78 --bg-surface : # 12131b ;
8384 Theme Overrides — Light Themes
8485 ========================================================================= */
8586
87+ [data-theme $= "-light" ] {
88+ color-scheme : light;
89+ }
90+
8691/* Cyber Light — cool blue-gray */
8792[data-theme = "cyber-light" ] {
8893 --bg-base : # f0f4f8 ;
Original file line number Diff line number Diff line change @@ -126,12 +126,16 @@ document.addEventListener('DOMContentLoaded', () => {
126126 localStorage . setItem ( 'theme' , theme ) ;
127127
128128 // Update meta theme-color after the CSS background transition completes
129- // This prevents an iOS Safari bug where the status bar text color inverts
129+ // Recreating the DOM node forces Safari to update the status bar correctly
130130 setTimeout ( ( ) => {
131- const metaThemeColor = document . querySelector ( 'meta[name="theme-color"]' ) ;
132- if ( metaThemeColor ) {
133- metaThemeColor . setAttribute ( 'content' , themeColors [ theme ] || '#0a0a0f' ) ;
131+ const oldMeta = document . querySelector ( 'meta[name="theme-color"]' ) ;
132+ if ( oldMeta ) {
133+ oldMeta . remove ( ) ;
134134 }
135+ const newMeta = document . createElement ( 'meta' ) ;
136+ newMeta . name = 'theme-color' ;
137+ newMeta . content = themeColors [ theme ] || '#0a0a0f' ;
138+ document . head . appendChild ( newMeta ) ;
135139 } , 400 ) ;
136140
137141 // Sync active state across all theme option buttons (desktop + mobile)
Original file line number Diff line number Diff line change 1919 } ;
2020 if ( saved && saved !== 'cyber' ) {
2121 document . documentElement . setAttribute ( 'data-theme' , saved ) ;
22- var meta = document . querySelector ( 'meta[name="theme-color"]' ) ;
23- if ( meta ) {
24- meta . setAttribute ( 'content' , themeColors [ saved ] || '#0a0a0f' ) ;
22+ var oldMeta = document . querySelector ( 'meta[name="theme-color"]' ) ;
23+ if ( oldMeta ) {
24+ oldMeta . parentNode . removeChild ( oldMeta ) ;
2525 }
26+ var newMeta = document . createElement ( 'meta' ) ;
27+ newMeta . name = 'theme-color' ;
28+ newMeta . content = themeColors [ saved ] || '#0a0a0f' ;
29+ document . getElementsByTagName ( 'head' ) [ 0 ] . appendChild ( newMeta ) ;
2630 }
2731 } ) ( ) ;
You can’t perform that action at this time.
0 commit comments