I want to change my website WordPress theme from light to dark mode. I want to use JS to make it much faster and easier. My question is, how can I replace the dark text color with white and the white background color with dark?
I can't add a tag to the classes, because I'm using elementor for WordPress.
I already have this code to change white backgrounds into dark ones, but how can I do that for fonts too?
(function () {
if (window.getComputedStyle(document.body, null).getPropertyValue("background-color") == "rgb(255, 255, 255)") {
console.log("Setting new background color...");
document.body.setAttribute("style", "background-color: #121212;");
}
})();