010101 when I add the script to the custom header/footer, it seems to work as expected.
I had to add the following to custom CSS to bring the button above Flarum's components:
.darkmode-toggle {
z-index: 100;
}
Without that z-index
rule, it was not possible for me to click the button. Were you experiencing this same issue ?
Not everything turns nicely into dark mode though, the header and banner stay in their original colors.