Right now selection background color is inverted when it matches the text color in Chromium. So if you have a rule like this "::selection { color: cyan; background: cyan; }" the background gets inverted and red color is used. This is an old behavior inherited from WebKit (https://trac.webkit.org/changeset/52548/webkit) but Safari doesn't do this anymore (and Firefox has never done this). The proposal is to stop inverting the background color for ::selection.


This will make ::selection to match other highlight pseudos (::target-text, ::highlight(), ::spelling-error and ::grammar-error).


Specification link

Specification currently under development in a Working Group

Status in Chromium


No longer pursuing (tracking bug)

Consensus & Standardization

After a feature ships in Chrome, the values listed here are not guaranteed to be up to date.

  • Shipped/Shipping
  • Shipped/Shipping
  • No signals


Last updated on 2021-10-07