Whether you also want to add dark mode, just follow me! Read:
Create file called switcher or other as you want, link it as defer in body tag and in switcher type the code:
function toggleDarkMode(){
document.body.classList.toggle("dark");
}
After it is, save JS File. Next, in your css stylesheet, add the following code. The given code contain only solid colors, you can change it to other colors as you need to suit them best in your site.
.dark{
color: white;
background-color: black;
}
Well, if you want to add different colors in different elements like div.container contains div.row and you want to add different colors in both of these, just use .dark.div.container div.row
. Code:
.dark.div.container div.row{
color: purple;
}
It is neccessary that the JS File should be linked. Create a button element in your body tag and set its content to Dark Mode or your choice and set a onclick attribute to call the toggleDarkMode() function.
<button onclick="toggleDarkMode()">Dark Mode</button>
You can also style anything excluding JS.