Closed meikei-99 closed 2 years ago
you can simply put dark mode properties in css
dark-mode {
background-color: black;
color: white;
}
then in html body link that with the javascript function
<button onclick="darkMode()"> Dark mode</button>
and then in script make this funtion
<script>
function darkMode() {
var element = document.body;
element.classList.toggle("dark-mode");
}
</script>
I thought I read about something maybe on stackoverflow where you would write code that would detect the users preffered theme.
That is an option if it works.
@meikei-99 that worked in the About page about.html I was able to test it.
Thanks for the PR!
*This is my first time opening a pull request, please advise me if I have made any mistakes.
I have added a light/dark toggle on the about.html page. If everything is all right, I will then proceed to add them to the rest of the HTML page.