Merged
Conversation
Collaborator
🎉 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) |
generate script tag based on user preference at page load no need for any mutation observers, because class is already set
fb79ed1 to
e0d0702
Compare
amitness
reviewed
May 11, 2025
| const getTheme = () => { | ||
| let baseTheme = document.getElementById('giscus-base-theme').value; | ||
| let altTheme = document.getElementById('giscus-alt-theme').value; | ||
| if (authorPrefersDark) { |
There was a problem hiding this comment.
Where is this authorPrefersDark variable defined? Utterances has stopped working for me because of this. Chrome raises an error due to undefined variable.
If I add the variable to the top of the page, it works.
Member
Author
There was a problem hiding this comment.
There was a problem hiding this comment.
Great to know, thank you! And yes I meant giscus.
Member
Author
There was a problem hiding this comment.
Fix released in 1.7.31
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Solves wrong-theming of Giscus in Chrome when Giscus is scrolled off-screen.
Generate script tag based on user preference at page load.
No need for mutation observer because class is already set.
This is the v1.7 backport of #12659