I’d like to inspect the mouse/keyboard text highlighting/selection in my browser, but don’t know how to inspect it. I need to inspect it so I can change it. I’m working on my website using this theme (https://github.com/mmistakes/minimal-mistakes) as the baseline, and the text highlighting is currently black, as you can see here:
So, how do I inspect and change this property in my CSS?
I’ve grep
ed my repo for cursor
, mouse
, user-select
.
I’ve googled a lot and can’t seem to find out what property I should be changing.
I’ve asked here too: https://github.com/mmistakes/minimal-mistakes/discussions/4392
2
Answers
Your issue pertains to the selection/highlighting of text in your browser, which can be manipulated in CSS via the
::selection
pseudo-element.This can be found in the Chrome DevTools, as shown in the image below (the selection is in orange):
For more information on how to utilize and manipulate this pseudo-element, you can refer to the documentation on the Mozilla Developer Network (MDN): https://developer.mozilla.org/en-US/docs/Web/CSS/::selection
I hope this helps resolve your issue!
Found this in the theme you’re using:
the file name is here
https://github.com/mmistakes/minimal-mistakes/blob/8a67ce8e41ec850f2d7c373aa47739b2abfee6f1/_sass/minimal-mistakes/_reset.scss#L40
You can override this by setting this css:
to your desired color