BugFix - Theme toggle from header#9
Merged
Conversation
…prove loading logic
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.
This pull request focuses on improving theme handling and simplifying the codebase for a website. The changes streamline the theme-switching logic, remove the theme toggle UI, and enhance the integration of the Giscus comments system with dynamic theme updates.
Theme handling improvements:
_includes/giscus.html: Updated the Giscus script to dynamically set the theme based onlocalStorageor default to dark, ensuring the correct theme is applied on load. Added a mechanism to check for the Giscus iframe more frequently and stop after 10 seconds for better performance. [1] [2]_includes/header.html: Simplified the theme initialization logic to apply the theme directly fromlocalStorageor default to dark, removing redundant checks for user preferences.Codebase simplification:
_includes/header.html: Removed the theme toggle UI, including its associated HTML and JavaScript, as it is no longer necessary with the updated theme handling logic.This pull request removes the theme toggle functionality from the_includes/header.htmlfile. The change simplifies the header by eliminating the associated HTML elements and JavaScript functionality.Key change:
_includes/header.html: Removed the theme toggle feature, including the checkbox input, label, and associated decorative elements (e.g., stars and craters), along with itsonclickevent handler for themodeSwitcher()function.