However, you can also add it to the webpage's code: Change CSS to include user preferences for dark/light mode in addition to the button on the site.
Directly from Tsiyon's notes (check with Tony on it's accuracy/efficiency) :
@media (prefers-color-scheme: dark) {
body { / Light text on dark background /
color: #ffffff;
background-color: #222222;
}
}
This is the media feature. It changes the browser theme based on the preference put in the OS.
Keep the dark/light button on the website.
However, you can also add it to the webpage's code: Change CSS to include user preferences for dark/light mode in addition to the button on the site.
Directly from Tsiyon's notes (check with Tony on it's accuracy/efficiency) : @media (prefers-color-scheme: dark) { body { / Light text on dark background / color: #ffffff; background-color: #222222; } } This is the media feature. It changes the browser theme based on the preference put in the OS.