you can define the dark mode styles in your CSS, and just use jQuery to toggle the dark-mode class. helpful for evening reading. I have a toggle and have borrowed a function that seems to work so far:
CSS:
#canvas-wrapper.dark-mode {
background: #222;
color: #DDD;
}
jQuery:
$(function() {
$(".switch").click(function() {
$("#canvas-wrapper").toggleClass("dark-mode");
});
});