Stack-Exchange-Userscripts
Stack-Exchange-Userscripts copied to clipboard
Fix dark mode detection for system theme for highlight unfolded comments
When the dark mode is set to ‘System setting’, the theme-dark class isn't present and instead theme-system is on the body element.

This PR uses window.matchMedia if the body class is theme-system to detect if the prefers-color-scheme is dark.
Fixes #22
Can this please be merged? @CertainPerformance
A workaround for now is to edit the userscript installed to include this patch (so you don't have to wait for this PR to be merged to use the fix).