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 enabling even though default is light mode #43

Open
auroraalabs opened this issue Mar 13, 2024 · 6 comments
Open

Dark Mode enabling even though default is light mode #43

auroraalabs opened this issue Mar 13, 2024 · 6 comments

Comments

@auroraalabs
Copy link

In the editor it shows up as light mode which is the correct depiction. User preference settings are also light mode.

When deployed: default shows as dark mode. When i toggle the button once it stays dark mode but when i toggle it again it goes back to light mode.

This only became an issue after I did an update yesterday, did something recently change?

Alternetively how can I remove dark mode entirely the existing instructions don't seem to work

@leonmelein
Copy link

Adding my two cents: after a theme update on a website I help manage, Dark Mode was suddenly enabled. The docs claim that Dark Mode can be disable easily sitewide, but the settings are nowhere to be found. Not even in the post or page editor.

@julianalsemmani
Copy link

@leonmelein Same issue. Can't find any settings on how to disable dark mode..

@badger3000
Copy link

From what I can tell, all the dark / light mode toggle does , is add / remove a class name from the body, along with setting and updating a cookie in your browser. Check to see if that cookie is present , if so , remove it and it should always default to light mode

Screenshot 2024-05-21 at 10 52 03 AM
Screenshot 2024-05-21 at 10 51 01 AM

@joakimscratx
Copy link

could we please find a solution to this for the free theme? The edit-on-click event won't solve this because the theme is responsive to device settings?

@joakimscratx
Copy link

I found a way. Added a custom html block to the header with the following:

<script type="text/javascript"> document.addEventListener('DOMContentLoaded', function() { // Function to delete a cookie by name function deleteCookie(name) { document.cookie = name + '=; Max-Age=0; path=/; domain=' + window.location.hostname; } // Check if the dark mode cookie exists var cookies = document.cookie.split('; '); for (var i = 0; i < cookies.length; i++) { var cookie = cookies[i]; if (cookie.indexOf('blockifyDarkMode=') === 0) { // Remove the dark mode cookie deleteCookie('blockifyDarkMode'); break; } } // Add 'is-style-light' class to the body document.body.classList.add('is-style-light'); }); </script>

@RickahTech
Copy link

any update on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants