Issue when switching between light and dark mode #5
Closed
khalidabuhakmeh
started this conversation in
General
Replies: 1 comment 2 replies
|
Looks good, however Your PR is welcome. |
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hello,
First of all, this is a great plugin. Thank you for developing it. Currently, I'm running into an issue where, upon navigating from a page after changing from
lighttodark,the theme gets set topreferred. This typically leads to a mismatch between light and dark themes.The seems to happen on pages that have yet to have a discussion created as well. The fix is pretty straightforward, but I wanted to check with you first.
It's to listen for giscus events and set the theme after a giscus event occurs. This ensures the theme is set correctly if for some reason the discussion is not found.
https://github.com/giscus/giscus/blob/main/ADVANCED-USAGE.md#giscus-to-parent-message-events
You can add this code to the end of the constructor of the
GiscusCommentsclass.All reactions