Theme switch template on Gist
The big question
The mediaSwitch fn. is okay, the btn click fn. also okay, but DOMContentLoad is a bit tricky: If we do not have cookie set, the behaviour is also trivial.
But if cookie set, and another value it has as the current time needed, what is the best value to return?
var useMode = Cookies.get('mode');
if (useMode == 'light') {
useDark = false;
} if (useMode == 'dark') {
useDark = true;
}
styleSetup();