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

The CSS Working Group just discussed `[css-pseudo-4] ::self-link pseudo, for self-linking`.

<details><summary>The full IRC log of that discussion</summary>
&lt;emilio> flackr: as TabAtkins wrote, it's a very common pattern (bikeshed etc mentioned)<br>
&lt;emilio> ... this adds a link to the heading that you can link to<br>
&lt;emilio> ... developers write tools to add these<br>
&lt;emilio> ... the proposal is to add a pseudo to generate this before the element<br>
&lt;emilio> ... long list of proposed behavior<br>
&lt;emilio> ... main one is it requires the content is linkable which means it has to have an ID attr<br>
&lt;Rossen9> ack fantasai<br>
&lt;emilio> fantasai: main issue, sometimes they want it at the start or at the end<br>
&lt;emilio> ... the other is sometimes you want a link to the container, not the heading itself<br>
&lt;emilio> ... e.g. &lt;section id=foo>&lt;h1>...<br>
&lt;emilio> ... you could add the id to both but the desired thing is to target the section<br>
&lt;emilio> ... so I like the idea<br>
&lt;emilio> ... I don't think it's a problem to do it with CSS<br>
&lt;emilio> ... but needs a way of solving these two<br>
&lt;emilio> flackr: the second seems more tractable<br>
&lt;emilio> ... we could allow it to refer to the nearest ancestor with id<br>
&lt;emilio> fantasai: that won't get you reasonable behavior for the fifth heading in the section or something<br>
&lt;emilio> ... you'd be jumping too high<br>
&lt;emilio> ... maybe fine<br>
&lt;emilio> ... but if you have somewhat unpredictable markup...<br>
&lt;emilio> ... [missed]<br>
&lt;emilio> ... it's a bit tricky<br>
&lt;emilio> flackr: not sure I understand the use case<br>
&lt;emilio> ... isn't the &lt;section> what you link the one you want?<br>
&lt;emilio> fantasai: the nearest element with an id might be &lt;main> or what not<br>
&lt;emilio> flackr: ah because they forgot or something<br>
&lt;emilio> 1+<br>
&lt;emilio> q+<br>
&lt;emilio> flackr: I supposed if there was a functional pseudo you could use `attr(id)` to refer to yourself or something<br>
&lt;emilio> fantasai: that might be more practical<br>
&lt;Rossen9> ack emilio<br>
&lt;emilio> ... I think those are my two concerns<br>
&lt;fantasai> scribe+<br>
&lt;fantasai> emilio: Is it well-defined to have generated interactive content?<br>
&lt;dandclark> emilio: My question is is it well defined to have generated interactive content?<br>
&lt;dandclark> ...What's the click event target?<br>
&lt;dandclark> ...Might be fine but might need some work on DOM side as well<br>
&lt;emilio> flackr: there is common behavior when you click on pseudos that you dispatch on the outer element, not great but...<br>
&lt;emilio> ... it is at least targettable<br>
&lt;emilio> ... we could explain this in the future<br>
&lt;dandclark> emilio: But I think the targets @@@ is mostly an effect of the generated content. Not quite pointer events but sort of. Must be targetable. Thinking about user-select.<br>
&lt;emilio> flackr: not sure I have the answer about how to support before / after<br>
&lt;emilio> q+<br>
&lt;Rossen9> ack emilio<br>
&lt;dandclark> emilio: What if instead of making new pseudo you make it content function or something? That way you can use ::before and ::after, can target anything<br>
&lt;emilio> ... that way you could use content: self-link(self) or self-link(closest) or something<br>
&lt;emilio> ... and would solve the before / after issue<br>
&lt;emilio> flackr: yeah<br>
&lt;emilio> Rossen9: let's take it back to the issue<br>
</details>


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


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

Received on Saturday, 28 September 2024 00:23:45 UTC