Re: [csswg-drafts] [css-pseudo-4] Ensuring selection foreground/background contrast (#6150)

> Chromium inverts the background color when the `::selection` color and background color are the same, e.g. `::selection { color: lime; background: lime; }`

Note that inverting colors does not guarantee contrast. The closer you get to a mid gray, the lower the contrast, with gray having 0 contrast since it is the inverse of itself. 

----

It seems like something that would really mitigate this problem is `contrast-color()`, which could be the default text color in the UA stylesheet, and could also be applied in cases like these.

-- 
GitHub Notification of comment by LeaVerou
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6150#issuecomment-1944432932 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 14 February 2024 19:09:53 UTC