TheOdinProject / theodinproject

Main Website for The Odin Project
http://www.theodinproject.com
MIT License
3.67k stars 2.07k forks source link

Feature Request: Option to make light/darkmode use the system settings #4225

Open ManonLef opened 11 months ago

ManonLef commented 11 months ago

Checks

Description of the Feature Request

I have no idea of the intricacies of implementing this at the moment, but it would be a nice feature to have the option to set the mode to whatever the current system mode is set to. So when users have dark mode enabled on their device, TOP will automatically switch to the dark theme as well if the user has activated that setting.

Some options I thought of:

Option 1: User settings

Add it as an option in the user settings. In this case they can toggle a system-dark/light-mode option. This would however not be available for people without an account.

Option 2: add a 3rd option on click

Currently, when you click on the icon, it just changes to the other option. We could iterate through 3 options on click as well. There should be some indication or explanation added of what each option represents then. The current symbols are clear enough, but I'm not sure if a system setting would be easily described by a symbol without text

Acceptance criteria

Additional Comments

No response

KevinMulhern commented 11 months ago

Thanks @ManonLef 💪 I agree it would a nice QOL upgrade to have.

Settings would be the ideal spot for me. But many users won't realise it's there. We saw that a lot when the theme switcher was in the user dropdown.

The UI pattern I'm always coming across for theme toggles that have more than 2 options is a dropdown:

Screenshot 2023-10-10 at 09 51 23

I think that could give us what we're looking for with this, and solve this issue at the same time lol

ManonLef commented 11 months ago

That looks like the best option indeed @KevinMulhern

If I'm correct, this section on TW system prefs could be relevant here

KevinMulhern commented 11 months ago

Yep, definitely relevant. The main thing we do different is store the theme in a cookie instead of local storage. But that shouldn't be a problem.