()
| 29 | |
| 30 | // Toggle theme and save preference. Returns the new theme. |
| 31 | function toggleAndSaveTheme() { |
| 32 | const current = document.documentElement.getAttribute('data-theme') || 'light'; |
| 33 | const next = current === 'light' ? 'dark' : 'light'; |
| 34 | applyTheme(next); |
| 35 | localStorage.setItem(THEME_STORAGE_KEY, next); |
| 36 | return next; |
| 37 | } |
| 38 | |
| 39 | // ============================================================================ |
| 40 | // Toggle Switch UI |
no test coverage detected
searching dependent graphs…