()
| 1 | function toggleTheme() { |
| 2 | const html = document.documentElement; |
| 3 | const themeIcon = document.getElementById('themeIcon'); |
| 4 | |
| 5 | if (html.getAttribute('data-theme') === 'dark') { |
| 6 | html.removeAttribute('data-theme'); |
| 7 | localStorage.setItem('theme', 'light'); |
| 8 | themeIcon.classList.remove('fa-moon'); |
| 9 | themeIcon.classList.add('fa-sun'); |
| 10 | } else { |
| 11 | html.setAttribute('data-theme', 'dark'); |
| 12 | localStorage.setItem('theme', 'dark'); |
| 13 | themeIcon.classList.remove('fa-sun'); |
| 14 | themeIcon.classList.add('fa-moon'); |
| 15 | } |
| 16 | } |
| 17 | |
| 18 | function setTheme() { |
| 19 | const html = document.documentElement; |
nothing calls this directly
no outgoing calls
no test coverage detected