Use CSS variables and JavaScript to toggle between light and dark themes.
Source Code
:root {
--primary-color: #fff;
--background-color: #000;
}
.dark-mode {
--primary-color: #000;
--background-color: #fff;
}
body {
background-color: var(--background-color);
color: var(--primary-color);
}