Exifly / ApiVault

Your gateway to a world of public APIs.
https://apivault.dev
Other
444 stars 40 forks source link

Change theme to save to browser storage #67

Closed kiabq closed 1 year ago

kiabq commented 1 year ago

Problem Currently, when the user loads into the site and changes the theme, it will only stay saved for the session. If the user refreshes or leaves the site, it will not save their theme choice or choose based off their device. Also, when loading in, there is a transition done in CSS that I'm wondering if we should change as it might unnecessarily transitioning elements that don't need it

Solution I would like to change the theme toggle to save their choice to browser storage or choose based on their system preference.

Screenshots Theme not saving on refresh (Before theme change and refresh there are a few black flashes, that's just my screenrecorder), Peek 2023-05-01 20-58

Transition all being put on all elements, while not being detrimental, I feel it makes user experience feel a bit jarring when first loading into the site. temp

gdjohn4s commented 1 year ago

Yeah i think you right. We should put the animation only on some elements and set the theme preference based on the system theme with the possibility to choose dark/light directly on the website Thanks for the advice.

NirajD10 commented 1 year ago

if it's merged, can we close the issue?