-
Notifications
You must be signed in to change notification settings - Fork 383
bugfix: giscus light dark toggle on load #12611
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
Conversation
🎉 Snyk checks have passed. No issues have been found so far.✅ security/snyk check is complete. No issues have been found. (View Details) ✅ license/snyk check is complete. No issues have been found. (View Details) |
Okay, it works with a Although this is a long chain of callbacks, and we did not manage to avoid I wish I could keep going and remove the author preference from the giscus parameters, since it makes things more complicated to have the base and alternate themes swapped, and I don't see what it helps. But think it’s easier and safer to expose |
not user preference which is kind of silly because it's usually the user's preference that matters, see next commit
i did see the iframe query fail once, but was unable to repro otherwise this seems to be reliable
because safari will run before giscus.js has created everything
865d5c8
to
e73d522
Compare
I just found this, because in my quarto blog, deployed as gh-pages, giscus is not loading and I see in my javascript console the following:
Any idea? |
Thanks @feinmann, I am able to reproduce with a site with Giscus but no dark mode. I'll look into a fix for this. |
@feinmann, this is fixed in 1.7.31 |
Thank you for the great work! It is already deployed :) |
Simpler alternative to #12608
Wait for giscus to load and then set its light/dark toggle immediately.
This is failing on Safari. May still need a Mutation Observer for the iframe.