We use some code which inject css directly into the document which changes the background property for some elements using the ::selection selector.
We can’t really change this code, but for some elements we want to revert their state back so they look/behave as if no background on ::selection had been set.
Changing the background on selection is easy, I can just do a:
*::selection { background: red; }
To make the background of all selected text red, but there does not seem to be any way to style the elements look when selected to be as if no background had ever been set.
The obvious solution would be *::selection { background:inherit; } but that don’t work because that sets the background to transparent, making text selection invisible.