Re: [csswg-drafts] [selectors] Pseudo-class to indicate when a slot has content (#6867)

The CSS Working Group just discussed `[selectors] Pseudo-class to indicate when a slot has content`.

<details><summary>The full IRC log of that discussion</summary>
&lt;lea> q+<br>
&lt;khush> keithamus: has slotted is a pseudo class. it is the opposite of definition of default slotted<br>
&lt;khush> has slotted means that it has been slotted<br>
&lt;astearns> ack astearns<br>
&lt;khush> we resolved on the issue to just have the ... pseudo-class<br>
&lt;lea> s/... pseudo-/:has-slotted pseudo-/<br>
&lt;khush> a bare pseudo class. not functional one<br>
&lt;khush> i want a functional one which takes a compound selector<br>
&lt;khush> lea has raised a PR of non-functional pseudo-class<br>
&lt;khush> could we resolve on both<br>
&lt;khush> lea: there are distinct use-cases for both<br>
&lt;khush> the non-functional version is not an alias for :has with *<br>
&lt;khush> have chatted with implementors, bare version is easier<br>
&lt;khush> i want it to move fwd<br>
&lt;khush> there is confusion with has(slotted)<br>
&lt;dbaron> s/with */with *, because the non-functional version also matches text nodes/<br>
&lt;khush> we don't have slotted pseudo-class, only pseudo element<br>
&lt;khush> there is potential confusion in terms of authors not understanding<br>
&lt;khush> but functionality is clear<br>
&lt;khush> i'm not sure if i would be in favour of fallback based naming<br>
&lt;khush> since we want it for other use-cases<br>
&lt;emilio> q+<br>
&lt;khush> but just mentionning<br>
&lt;astearns> ack lea<br>
&lt;khush> emilio: the bare version is very straightforward<br>
&lt;dbaron> s/i'm not sure if/we could name it something related to fallback, but I'm not sure if/<br>
&lt;astearns> ack emilio<br>
&lt;khush> the functional version feels hard to implement. naming suggests we're looking at descendants. what's supported would be confusing<br>
&lt;lea> q+ to also mention :has-slotted variant that excludes whitespace-only slotted nodes<br>
&lt;TabAtkins> I don't think it would be that confusing. It would be interpreted basically identically to ::slotted()<br>
&lt;khush> keithamus: there is confusion around what combinators would do<br>
&lt;dbaron> s/for other use-cases/even if there's no fallback content/<br>
&lt;khush> should only match the slotted element<br>
&lt;TabAtkins> If ::slotted(.foo) would match an element, :has-slotted(.foo) will match<br>
&lt;fserb> q+<br>
&lt;khush> emilio: it might be worth naming it after nth-child perhaps<br>
&lt;khush> has it been considered?<br>
&lt;astearns> zakim, close queue<br>
&lt;Zakim> ok, astearns, the speaker queue is closed<br>
&lt;khush> the naming is off and confusing, otherwise it's fine<br>
&lt;khush> the bare version is extremely simple to implement<br>
&lt;khush> emilio: you mentioned you wanted it to also match fallback content.<br>
&lt;khush> lea: if we wanna change the naming to not confuse with has, it could be fallback-show<br>
&lt;khush> the matching would be the same logic<br>
&lt;khush> q?<br>
&lt;astearns> ack lea<br>
&lt;Zakim> lea, you wanted to also mention :has-slotted variant that excludes whitespace-only slotted nodes<br>
&lt;khush> lea: since this has to reflect the behaviour of existing js api<br>
&lt;khush> even if only slotted is blank white space node it still has to match<br>
&lt;khush> we want a bare slotted version which includes just whitespace<br>
&lt;khush> is that easy to implement><br>
&lt;khush> ?<br>
&lt;astearns> ack fserb<br>
&lt;khush> fserb: maybe the name would be better as revered<br>
&lt;khush> has-fallback-content for example<br>
&lt;lea> :fallback-shown is also nicely analogous to :placeholder-shown. What happens with that pseudo-class if there is no placeholder on the input?<br>
&lt;khush> keithamus: i like the symmetry between the 2. renaming would make them asymetrical and cause confusion<br>
</details>


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


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

Received on Friday, 27 September 2024 01:03:41 UTC