Re: [csswg-drafts] Pseudo classes for the `interesttarget` API (#12154)

> No, it was a functional pseudoclass that took a few keywords letting you indicate _exactly_ what variety of interest you wanted to match on (while the non-functional one defaulted to some form of interest that we think is likely the most useful). So `:interest-invoker(partial)`.

Oh! Duh, reading it again, I can see this clearly. I like this idea! Are there other functional pseudo classes that also work without the `()`? Either way I like the idea, and my vote would be for `:interest-invoker` (without `()`) to  be sugar for `:interest-invoker(total)` - that's usually the most useful selector, since it's a superset of `:interest-invoker(partial)`.

> I think that's fine - the `interesttarget` attribute indicates which element is the interest target. It doesn't indicate that the element with the attribute _is_ the interest target.

Fair enough.

> > > Do we want to expose a state keyword for things that are potentially interest invokers/targets, but that are currently without any interest? Or is that ambiguous when interest isn't being shown?

> > Hmm. I think that can be handled with [interesttarget]:not(:interest-invoker), no? Perhaps you just mean it might be convenient to have a shorthand for that?

> I wasn't sure there was a way to express that; not all negative selectors actually can be written explicitly in a simple manner. I think a shorthand is convenient, yes, since you're likely writing your actual-interest selectors as just `:interest-invoker`, and having to add the `[interesttarget]` (to avoid `:not(:interest-invoker)` over-matching on the rest of the page) isn't super obvious.

Ok - I guess maybe the shorthand would be `:interest-invoker(none)` or something?

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


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

Received on Monday, 5 May 2025 22:45:36 UTC