Skip to content

Suggest a better name for the :interest-target pseudo class #12515

@mfreed7

Description

@mfreed7

We resolved to add two pseudo classes for the interest invokers API:

  • :interest-invoker - matches an element with the interestfor attribute that currently "has interest".
  • :interest-target - matches an element that is the target of an element with interestfor, while that invoker element "has interest".

To help the discussion, here's an example code snippet:

<a href=# interestfor=target id=invoker>Invoker</a>
<div popover id=target>Popover</div>

It was raised (see 1 and 2 for example) that the :interest-target name is a bit confusing. When you "show interest" in something, the "target" of your interest is that element. But also, when you say interestfor=foo, you could say that #foo is the target of the invoker. So it's ambiguous to use "target". If there's a better set of words that make this clear, that would be very helpful.

I did the modern thing and plugged this into an LLM and here's what it suggested. Perhaps one of these works better? The first one (:interest-invoked) isn't bad...

Suggested Name Pros Cons
:interest-invoked Strong symmetry with :interest-invoker. Unambiguous. Less declarative, more procedural.
:of-interest Very high readability, uses natural language. Conceptually pure. Asymmetrical pairing with :interest-invoker.
:interest-triggered Clearly communicates cause-and-effect. Uses familiar UI term. "Trigger" might imply a more discrete action.
:interest-indicated Accurately describes the link made by the interestfor attribute. More technical, less immediately obvious.

Are there better suggestions?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions