WICG / scroll-to-text-fragment

Proposal to allow specifying a text snippet in a URL fragment
Other
589 stars 42 forks source link

Text Fragment's highlight's color might collide with its text's color #208

Closed luisjuansp closed 10 months ago

luisjuansp commented 1 year ago

Whenever a page is setting the color of text, either via a pseudo element or just normal style rules, they have to be careful not to collide with the UA default colors for ::target-text or else have accessibility issues. It seems unlikely for the authors to do that if they are not using this feature, and third-party pages that do have no way of resolving it.

This scenario could likely happen if an anchor is within the bounds of the fragment, as their text's color, as well as the ::visited color, are similar to the Text Fragment's highlight's color.

bokand commented 10 months ago

This is certainly a possibility but authors are able to address this with ::target-text (granted, some won't). That said, this seems more appropriately addressed by UAs, by making their marker distinct (e.g. with a border or some motion) or altering the color when this situation is detected.

I'm going to close the issue since I don't think there's anything actionable for this spec and this repo is basically in maintenance mode. Future enhancements should be taken up in the HTML standard.