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

dark mode toggle button not working #12

Open
adhilsalim opened this issue Apr 21, 2023 · 1 comment
Open

dark mode toggle button not working #12

adhilsalim opened this issue Apr 21, 2023 · 1 comment
Labels
bug Something isn't working low priority This issue is not critical and can be addressed at a later time wont fix This will not be fixed.

Comments

@adhilsalim
Copy link
Member

No description provided.

@adhilsalim adhilsalim added the bug Something isn't working label Apr 21, 2023
@adhilsalim
Copy link
Member Author

<script>
    let mode = window.localStorage.getItem('mode'),
      root = document.getElementsByTagName('html')[0];
    if (mode !== null && mode === 'dark') {
      root.classList.add('dark-mode');
    } else {
      root.classList.remove('dark-mode');
    }
  </script>

Include this script in pages

@adhilsalim adhilsalim assigned AkhilLV and adhilsalim and unassigned AkhilLV and adhilsalim May 7, 2023
@adhilsalim adhilsalim added low priority This issue is not critical and can be addressed at a later time wont fix This will not be fixed. labels May 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working low priority This issue is not critical and can be addressed at a later time wont fix This will not be fixed.
Projects
None yet
Development

No branches or pull requests

2 participants