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

Give priority to theme stored in localstorage #23

Conversation

koyama-tagbangers
Copy link
Contributor

This PR fix an issue applying dark mode forcely when prefers-color-scheme value is dark even though theme value is stored in localstorage.

I change to use prefers-color-scheme value only if theme value is not stored in localstorage or is an invalid value.

koyama-tagbangers and others added 3 commits March 20, 2021 03:22
Ignore 'prefers-color-scheme' value if the theme is stored in local storage.
The change occurred automatically after 'npm install'.
@philwebb philwebb added this to the 0.0.x milestone Apr 6, 2021
@pivotal-cla
Copy link

@koyama-tagbangers Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@pivotal-cla
Copy link

@koyama-tagbangers Thank you for signing the Contributor License Agreement!

philwebb pushed a commit that referenced this pull request Jun 10, 2021
Update `isInitialThemeDark` so that any value loaded from local-storage
takes precedence. Prior to this commit, if the browser preferred the
dark theme then the saved light theme would never be restored.

See gh-23
@philwebb philwebb closed this in caa0a60 Jun 10, 2021
philwebb added a commit that referenced this pull request Jun 10, 2021
* pr/23:
  Polish 'Fix dark scheme detect function'
  Fix dark scheme detect function

Closes gh-23
@philwebb
Copy link
Contributor

Thanks for the fix and for signing the CLA. This has now been merged

@philwebb philwebb modified the milestones: 0.0.x, 0.0.2 Jun 10, 2021
@koyama-tagbangers koyama-tagbangers deleted the fix-dark-scheme-detect-function branch June 14, 2021 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants