Skip to content

Commit

Permalink
Create darklight.js
Browse files Browse the repository at this point in the history
  • Loading branch information
sv410 authored Oct 19, 2024
1 parent aaa1377 commit 1db1172
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions darklight.js
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit 1db1172

Please sign in to comment.