Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Light mode does not persist on title page after refresh #334

Open
travisk-codes opened this issue Sep 7, 2020 · 6 comments
Open
Labels
flag:help wanted Extra attention is needed priority:high Important issue type:bug Something isn't working

Comments

@travisk-codes
Copy link
Contributor

Description:
When light mode is enabled, refreshing the title page will revert it back to dark mode.

To Reproduce:

  1. Enable light mode
  2. Navigate back to the title page
  3. Refresh the page

Expected Behavior:
Light mode to persist after refresh

Environment:

  • OS: 5.8.6-arch1-1
  • Browser: Firefox 80.0.1 (64-bit)
  • Browser: Chromium 85.0.4183.83 (64-bit)
@veksen
Copy link
Collaborator

veksen commented Sep 8, 2020

The issue seems to happen on every layout, part of the layout doesn't take account the localStorage value:

https://theprogrammershangout.com/resources/javascript/

image

@veksen veksen added flag:help wanted Extra attention is needed priority:high Important issue type:bug Something isn't working labels Sep 8, 2020
@travisk-codes
Copy link
Contributor Author

travisk-codes commented Sep 8, 2020

I am able to reproduce on prod, but not on develop master. Are you?

prod steps: light mode -> refresh -> switches to dark mode with black text
dev steps: light mode -> refresh -> stays in light mode

@veksen
Copy link
Collaborator

veksen commented Sep 8, 2020

I'm feeling like it's related to statically generated generated Gatsby assets

@veksen
Copy link
Collaborator

veksen commented Sep 8, 2020

yes 100%: https://joshwcomeau.com/gatsby/dark-mode/ improved solution from what we have

@travisk-codes
Copy link
Contributor Author

I'll look into it--does it look like a major overhaul?

@veksen
Copy link
Collaborator

veksen commented Sep 9, 2020

No we have the majority of the groundwork already for it, it's mainly injecting some JS at runtime before Gatsby runs which is covered by the article.

SagnikPradhan added a commit to SagnikPradhan/website-1 that referenced this issue Oct 1, 2021
veksen pushed a commit to SagnikPradhan/website-1 that referenced this issue Oct 19, 2021
veksen pushed a commit to SagnikPradhan/website-1 that referenced this issue Oct 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flag:help wanted Extra attention is needed priority:high Important issue type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants