Skip to content
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

Make Disqus work with Hydejack's color toggle and transfer animation #355

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

felixnie
Copy link

For the demo, check https://felixnie.com or https://draftz.felixnie.com. The comment system might change since I'm trying to bring more (like Waline) to my beloved themes, so here is how it looks:

hydejack-colors-screen-recording

This PR carries out several fixes for issues that most Disqus users will encounter with Hydejack. They are:

  • A simple workaround for a dark mode background rendering issue.
  • Refinements for the missing page.identifier parameter required by Disqus.
  • The closed Fix disqus embed.js link #244.
  • Reset Disqus component after clicking the light mode/dark mode button.

The first issue is spotted on my Safari browser.

Snipaste_2025-01-17_20-37-15

The issue is first spotted on Chrome, and is probably fixed by the Chromium team. (confirmation required)

Link: https://stackoverflow.com/questions/65260505/disqus-iframe-transparency-wont-work-on-chrome-87

The last fix reloads Disqus 500ms after the clicking event. The color transfer animation takes ~250ms. Disqus will check the text color to decide which mode it is. So it's better to wait till the animation finishes.

Remember to set your dark mode text color properly so that it's bright enough:

How is the color scheme determined?
The light scheme is loaded when the text color Disqus inherits from your site has >= 50% gray contrast: between color: #000000; and color: #787878;
The dark scheme is loaded in all other instances.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant