How can I “undo” a CSS specification for the ::selection attribute

I’m using an application framework that includes default CSS styling for ::selection, but I prefer my browser’s default behavior.

In fact, I find I prefer my browser’s default behavior to any specification for color and background-color for ::selection. They are opaque where the default is transparent, and they change the color of the text where the default does not.

My question is: Is there any way to “undo” or “revert” this styling, or is it the case that once the color and background-color attributes are defined, they can only be overridden with other equally explicit values?

If so, that would seem to be a shame!


solution

You could just overwrite the properties with the value initial to set it back to browser defaults:

::selection {
  color:initial;
  background:initial;
}

EXAMPLE HERE