This commit makes the dark mode preview feel a little more interactive and it also pulls some duplicated code into one file so that people like me aren't stumped when they are looking at the wrong page!