You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had an issue with another website that was fixed by clearing my browser cache. As a result, I had to log in to all of my sites again. I ended up on Reddit which defaulted to light mode for unauthenticated users, and realised that freeCodeCamp does the same.
... we should leverage the user's system setting ...
I'm not against this - although, I think the bigger issue is that you can only switch the theme if you are logged in. Seems like you should be able to switch regardless. I don't recall if there was any reason that we don't allow that.
So the logic should be the followings:
// if user has a set a preference, set the theme
// else if system setting has a theme, set the theme,
// else set the theme as default.
Do we want to allow non-authed users to switch to night mode using the menu? I feel like we should. If so, we may not need some of this logic (or, may need more).
I think we should allow non-auth users to switch theme.
If users have not set a preference in the localhost and have a theme preference on their record, we could pull that data and set it accordingly if possible. Moving forward we would not want to use the user records for theme switching.
@ahmadabdolsaheb, @ojeytonwilliams, @raisedadead. I want to bring back the discussion to the issue, and finalize the solution before the implementation.
I have a looked into different implementation, and the one from Mozilla foundation seems the most fitting to me and want to discuss it with you.
What do you think of 3rd option for OS system? So people can have an opt-in system option, when the ability to store data hinder the camper experience, because they want to have different themes in different devices.
They should be a drop-down on the settings page. Dropdowns make it very nice and clear of the selection and not to mention easiest to maintain (a11y and UX wise, etc.).
There was a very strong argument to keep the theme in the nav and was a very common request. I wonder if the toggle can be converted into a similar UX as the language selector, then we would be set.
They should be a drop-down on the settings page. Dropdowns make it very nice and clear of the selection and not to mention easiest to maintain (a11y and UX wise, etc.).
We can come back to the dropdown, when we add new themes. Maybe we create a different component that display part of the page in different themes instead, like GitHub. So let's not spend our effort on this yet, while the one we're currently having something that is working. 👍
They should be a drop-down on the settings page. Dropdowns make it very nice and clear of the selection and not to mention easiest to maintain (a11y and UX wise, etc.).
I am worried that we will run into the issue of it being obscure, like what we have in the language selector.
We can come back to the dropdown, when we add new themes.
A wise man (Quincy) once said, you should avoid introducing big changes to UI. If you have to, then delay and introduce them all at once, because you WILL get called out for doing something radical. Might as well do it fewer times.
Point being, if you are building something that you are going to throw away (and you know it), you are doing it wrong. 🤷🏽
Themes switchers seems to be the convention in blog/documentation website navigations. As the app gets more complicated, the theme switcher gets relocated to the settings.
The language selector is moving to the top navigation. If we rely on the settings page's theme switcher, we could remove related section from the dropdown navigation entirely. That being said, if there is a lot of demand for it, we should keep it around in the nav.
If we keep the theme switcher in the nav, it makes sense to use a component that looks good on mobile such as a dropdown so we could reuse it in the settings page as well.
Activity
moT01 commentedon Aug 16, 2022
Yes, we default to light mode.
I'm not against this - although, I think the bigger issue is that you can only switch the theme if you are logged in. Seems like you should be able to switch regardless. I don't recall if there was any reason that we don't allow that.
iarmankhan commentedon Aug 21, 2022
@moT01 Wouldn't it be more helpful to have night-mode for non-logged in user as well, and also it defaults to system's theme?
ahmaxed commentedon Aug 31, 2022
So the logic should be the followings:
// if user has a set a preference, set the theme
// else if system setting has a theme, set the theme,
// else set the theme as default.
We could set the theme in the localstorage and pull it up on the upcoming sessions.
Reference: https://github.com/gaearon/overreacted.io/blob/master/src/html.js#L21-L48
moT01 commentedon Sep 21, 2022
Do we want to allow non-authed users to switch to night mode using the menu? I feel like we should. If so, we may not need some of this logic (or, may need more).
ahmaxed commentedon Sep 23, 2022
I think we should allow non-auth users to switch theme.
If users have not set a preference in the localhost and have a theme preference on their record, we could pull that data and set it accordingly if possible. Moving forward we would not want to use the user records for theme switching.
naomi-lgbt commentedon Nov 9, 2022
To resolve this issue in the short term:
night: We should display night mode (the current behaviour)default: We should respect the system settings for the theme.2 remaining items
Sboonny commentedon Dec 19, 2022
@ahmadabdolsaheb, @ojeytonwilliams, @raisedadead. I want to bring back the discussion to the issue, and finalize the solution before the implementation.
I have a looked into different implementation, and the one from Mozilla foundation seems the most fitting to me and want to discuss it with you.
What do you think of 3rd option for OS system? So people can have an opt-in system option, when the ability to store data hinder the camper experience, because they want to have different themes in different devices.
ojeytonwilliams commentedon Dec 19, 2022
Sure, that sounds good.
Sboonny commentedon Jan 6, 2023
@ahmadabdolsaheb, I lost the notes because of the holiday so I am not sure, we didn't want the themes to be a dropdown, but just buttons for now.
Was that about the menu or the setting picker? I am not sure.
ahmaxed commentedon Jan 6, 2023
We can keep them as buttons. Also, we could remove the theme switching from the navigation entirely.
raisedadead commentedon Jan 6, 2023
My two cents:
Sboonny commentedon Jan 6, 2023
We can come back to the dropdown, when we add new themes. Maybe we create a different component that display part of the page in different themes instead, like GitHub. So let's not spend our effort on this yet, while the one we're currently having something that is working. 👍
I am worried that we will run into the issue of it being obscure, like what we have in the language selector.
raisedadead commentedon Jan 6, 2023
A wise man (Quincy) once said, you should avoid introducing big changes to UI. If you have to, then delay and introduce them all at once, because you WILL get called out for doing something radical. Might as well do it fewer times.
Point being, if you are building something that you are going to throw away (and you know it), you are doing it wrong. 🤷🏽
ahmaxed commentedon Jan 6, 2023
Themes switchers seems to be the convention in blog/documentation website navigations. As the app gets more complicated, the theme switcher gets relocated to the settings.
The language selector is moving to the top navigation. If we rely on the settings page's theme switcher, we could remove related section from the dropdown navigation entirely. That being said, if there is a lot of demand for it, we should keep it around in the nav.
If we keep the theme switcher in the nav, it makes sense to use a component that looks good on mobile such as a dropdown so we could reuse it in the settings page as well.
Sboonny commentedon Jan 26, 2023
Based on discussion with @ojeytonwilliams:
ahmaxed commentedon Jan 27, 2023
If the logic seem convoluted, feel free to lay it down in pseudo code.
Once everyone is in agreement, we can proceed with the implementation.
moT01 commentedon Jun 6, 2024
Closing as stale. Thanks and happy coding 🎉