sandoche / Darkmode.js

🌓 Add a dark-mode / night-mode to your website in a few seconds
https://darkmodejs.learn.uno
MIT License
2.72k stars 176 forks source link

Highlighting Color Changes #23

Closed varlevi closed 4 years ago

varlevi commented 4 years ago

Is it possible to make the text highlight color not change color in dark mode? If not, is this a feature that could be considered.

sandoche commented 4 years ago

You can try to add this one of these two style to your css if you use mark for the text highlighting:

mark {
  isolation: isolate;
}

.darkmode--activated mark {
  mix-blend-mode: difference;
}
varlevi commented 4 years ago

Sorry I was unclear here. I meant the color of text when the user selects it. I've always thought of it as highlighting, even though select is the correct word! Is there any solution to this question?

sandoche commented 4 years ago

You can try with this selector: https://css-tricks.com/almanac/selectors/s/selection/