Text selection highlight

Widely available Reference ↗

::selection styles text selected by the user. A small color adjustment can make selection feel part of the design without replacing native behavior.

::selection {
  color: #ffffff;
  background: #4937c7;
}  

Only a limited set of properties applies. Keep strong contrast and do not remove the visual distinction between selected and unselected text.