[csswg-drafts] [css-pseudo-4] Do we need a specialized :target pseudoclass for scroll-to-element? (#6825)

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

== [css-pseudo-4] Do we need a specialized :target pseudoclass for scroll-to-element? ==
In the scroll to selector extension to the scroll-to-text-fragment [explainer](https://github.com/WICG/scroll-to-text-fragment/blob/main/EXTENSIONS.md) we propose adding a fragment directive which selects elements. When we scroll to these, as with scrolling to text, there is a desire to have a default style which calls attention to the element. In this particular case an outline is the current leading proposal.

As with scroll-to-text issue #5522, this style should be customizable by the developer. Semantically, the [:target pseudoclass](https://drafts.csswg.org/selectors/#the-target-pseudo) perfectly describes this target, however adding a default UA style to outline targeted elements would affect the style of existing anchor fragment navigation elements in an undesirable way.

This leads to the question in the issue, do we need a new pseudoclass for these targets? Or, should we use :target, and if so is there a way to ensure the default UA style for fragment directive targets is not applied on anchor navigation? With :target-text we had no issues as this was an entirely new concept and so would not have existing styles or navigation cases which activated it.

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


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

Received on Tuesday, 23 November 2021 15:37:59 UTC