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

Light mode doesn't persist on navigation/refresh #414

Open
samcunliffe opened this issue Jun 11, 2024 · 3 comments
Open

Light mode doesn't persist on navigation/refresh #414

samcunliffe opened this issue Jun 11, 2024 · 3 comments
Labels
bug Something isn't working website Related to https://github-pages.arc.ucl.ac.uk/python-tooling

Comments

@samcunliffe
Copy link
Member

Describe the Bug

When browsing the website in light mode, the theme switches on every refresh.

To Reproduce

Switch to light mode and refresh the website.

Expected Behaviour

The website stays in light mode.

Actual Behaviour

The website switches theme back to dark mode.

Additional Context

- Operating system: Tested in Chrome Android/mobile and Firefox on Mac.
@samcunliffe samcunliffe added bug Something isn't working website Related to https://github-pages.arc.ucl.ac.uk/python-tooling labels Jun 11, 2024
@paddyroddy
Copy link
Member

Never considered using light mode, but can confirm this. It's not ideal...

@paddyroddy
Copy link
Member

Related to just-the-docs/just-the-docs#1223

@samcunliffe
Copy link
Member Author

Looks like we might need to persist the choice in JS...

  <script>
    if (localStorage.getItem('theme') === 'dark') document.documentElement.classList.add('dark-mode');
  </script>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working website Related to https://github-pages.arc.ucl.ac.uk/python-tooling
Projects
None yet
Development

No branches or pull requests

2 participants