TimTree / games-by-tim

The Games by Tim website.
https://www.gamesbytim.com
0 stars 0 forks source link

Change comments color palette on dark mode #2

Open TimTree opened 4 years ago

TimTree commented 4 years ago

It is indeed possible to dynamically change the comments colors for dark mode: https://talk.hyvor.com/documentation/faq/dynamically-change-colors

The solution is to run hyvor_talk.setPalette(PALETTE_OBJ_FOR_DARK_MODE); in the JavaScript function that swaps light/dark mode. However, the plugin gatsby-plugin-dark-mode injects a predefined dark mode function, which I cannot easily modify. I may need to re-implement dark mode from scratch, a nontrivial task.

TimTree commented 3 years ago

Thanks to a recent update to the hyvor-talk-react plugin, I was able to implement dark mode comments in commit 19ef83d.

However, the comments will not change color schemes if the user toggles the theme after the comments have loaded. For that to happen, I'll probably need to use the above solution.