File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3232 if(s) s.classList.toggle('open');
3333 ">☰</button>
3434 <a href="${ prefix } error/index.html" id="nav-errors-link"${ isActive ( 'error' ) ? ' class="active"' : '' } >Errors</a>
35- <button id="nav-dark-btn" onclick="window.__toggleDark&&window.__toggleDark()" style="background:none;border:1px solid #e0e0e0 ;color:#555; padding:3px 10px ;border-radius:4px;font-size:12px;cursor:pointer;margin-left:0.5rem;">🌙</button>
35+ <button id="nav-dark-btn" onclick="window.__toggleDark&&window.__toggleDark()" style="background:#111 ;color:#fff;border:none; padding:4px 12px ;border-radius:4px;font-size:12px;cursor:pointer;margin-left:0.5rem;font-weight:600; ">🌙 Dark </button>
3636 ` ;
3737 }
3838
121121 function applyDark ( on ) {
122122 document . body . classList . toggle ( 'dark-mode' , on ) ;
123123 const btn = document . getElementById ( 'nav-dark-btn' ) ;
124- if ( btn ) btn . textContent = on ? '☀️ Light' : '🌙 Dark' ;
124+ if ( btn ) {
125+ btn . textContent = on ? '☀️ Light' : '🌙 Dark' ;
126+ btn . style . cssText = on
127+ ? 'background:#fff;color:#111;border:1px solid #555;padding:4px 12px;border-radius:4px;font-size:12px;cursor:pointer;margin-left:0.5rem;font-weight:600;'
128+ : 'background:#111;color:#fff;border:none;padding:4px 12px;border-radius:4px;font-size:12px;cursor:pointer;margin-left:0.5rem;font-weight:600;' ;
129+ }
125130 if ( window . editor && window . editor . setOption )
126131 window . editor . setOption ( 'theme' , on ? 'cppmode-dark' : 'cppmode' ) ;
127132 try { localStorage . setItem ( 'darkMode' , on ? '1' : '0' ) ; } catch ( e ) { }
You can’t perform that action at this time.
0 commit comments