Skip to content

Commit 75ce95b

Browse files
Fix dark mode detection for highlight unfolded comments
1 parent c3d3b3d commit 75ce95b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Highlight-Unfolded-Comments/StackHighlightUnfoldedComments.user.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ const observeContainer = (commentsContainer) => {
5757
}
5858
for (const comment of newComments) {
5959
window.setTimeout(() => {
60-
const highlightColor = document.body.matches('.theme-dark')
60+
const highlightColor = window.location.hostname === 'stackoverflow.com' && window.matchMedia('(prefers-color-scheme: dark)').matches
6161
? '#403d33' // Dark brown, close to default dark background
6262
: '#fff2e0'; // Pale yellow, close to default light background
6363
// eslint-disable-next-line no-param-reassign

0 commit comments

Comments
 (0)