1
0
mirror of https://github.com/cotes2020/jekyll-theme-chirpy.git synced 2026-06-21 23:38:39 +00:00
Files
jekyll-theme-chirpy/_includes/comments
Cotes Chung ceb2a41463 fix(giscus): synchronize theme state during lazy loading (#2742)
Previously, theme switch events were lost if triggered before the
Giscus iframe was fully loaded (e.g., when deferred by lazy loading
or before the client script executed). This resulted in Giscus
rendering with the outdated initial theme once it finally appeared
in the viewport.

This commit handles these edge cases by:
1. Updating the `data-theme` attribute on the Giscus script node
   if the iframe hasn't been created yet.
2. Modifying the `theme` query parameter in the iframe's `src` URL
   if it is currently in a pending/lazy-loading state.
2026-05-23 23:00:48 +08:00
..