(e)
| 1 | const toggleSwitch = document.querySelector('.theme-switch input[type="checkbox"]'); |
| 2 | |
| 3 | function switchTheme(e) { |
| 4 | if (e.target.checked) { |
| 5 | document.documentElement.setAttribute('data-theme', 'dark'); |
| 6 | } |
| 7 | else { |
| 8 | document.documentElement.setAttribute('data-theme', 'light'); |
| 9 | } |
| 10 | } |
| 11 | |
| 12 | toggleSwitch.addEventListener('change', switchTheme, false); |
| 13 |
nothing calls this directly
no outgoing calls
no test coverage detected