Re: [csswg-drafts] [css-pseudo-4] ::self-link pseudo, for self-linking (#10498)

Okay, so distilling the TPAC comments (thanks for running the topic, @flackr!):

* make it capable of linking to ancestors; probably just "the first element in its originating elements inclusive ancestors that's linkable".
* make sure that focusable/activatable pseudo-elements are well-defined (this is also needed for the Carousel stuff, so I presume I can piggyback on that proposal)
* rather than a dedicated pseudo (and having to deal with the "does it go before or after" issue), just extend the power of ::before/::after to handle this, either with a new 'content' value, or a new property that only works on those pseudos

I like these ideas! So, here's a new proposal to discuss:

Add a new `link` property, only usable on ::before/::after. Its grammar is `none | self | <url> | <string>`, and it makes the pseudo-element a link, as described earlier in this thread. The `self` keyword causes it to link to the first element in its originating element's inclusive ancestors that is linkable (aka, has an ID); the `<url> | <string>` value just makes it a link to that URL. (Mostly useful to, say, grab something from a `data-*` attribute with `attr()`.)

This rough idea has been proposed in the past, fwiw, but I can't find the old emails about it because Gmail search is a lot less useful now.

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


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

Received on Wednesday, 2 October 2024 23:11:53 UTC