[csswg-drafts] [css-pseudo-4] single highlight pseudo for find-in-page? (#10212)

delan has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-pseudo-4] single highlight pseudo for find-in-page? ==
> 1. **Do we really need two highlight pseudos, or would a pseudo-class like ::search-match:active make more sense?** Since ::active-search and ::inactive-search sound like they would be mutually exclusive, this may just be a question of elegance, not ambiguity like in #4579.

#3812 suggests adding two new highlight pseudos, ::active-search and ::inactive-search, for find-in-page search results. But these highlights are mutually exclusive, so they need not be two separate pseudo-elements and highlight overlays.

We propose instead adding a single highlight pseudo with a pseudo-class ([selectors #pseudo-element-states](https://drafts.csswg.org/selectors/#pseudo-element-states)), such as `::search-text:active`. You would select `::search-text` for all matches, `::search-text:active` for the active match, or `::search-text:not(:active)` for the other matches.

The exact naming is not critical, but `::search-text` would be by analogy with `::target-text`, and clearly describes the thing being highlighted (like `::spelling-error`), more so than alternatives like `::search-match` or `::find-in-page`.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10212 using your GitHub account


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

Received on Tuesday, 16 April 2024 04:17:38 UTC