diff --git a/darklight.js b/darklight.js new file mode 100644 index 00000000..ab713444 --- /dev/null +++ b/darklight.js @@ -0,0 +1,7 @@ +toggle_switch = document.querySelector('#dark-mode'); + +toggle_switch.addEventListener 'input', -> + label = @labels[0]; + body = document.body; + + body.dataset.darkMode = label.dataset.darkMode = @checked;