CSS :interest-source and :interest-target Pseudo-Classes

Style connected UI with the :interest-source and :interest-target pseudo-classes. Interactive examples of tooltips, forms and navigation without JavaScript.

CSS is getting new pseudo-classes that let you style elements based on user interest. The :interest-source and :interest-target pseudo-classes work with the interestfor HTML attribute to create relationships between elements, enabling interactive UIs without JavaScript.

These pseudo-classes are part of the Open UI Interest Invokers proposal, recently accepted by the CSS Working Group. They handle scenarios where hovering or focusing one element should affect the styling of another element elsewhere in the DOM.

Update: Chrome 142 shipped interest invokers

Chrome 142 (October 28, 2025) shipped the interestfor attribute, :interest-source, :interest-target and the interest-delay properties with no flag (Chrome Platform Status, MDN). Firefox and Safari don’t support them yet, so keep the @supports fallback below. The pseudo-classes now live in Selectors Level 5, and the shipped versions take no partial or total argument.

Corrected: the form example’s CSS set ring:, which isn’t a CSS property. It now uses box-shadow, the property that draws the ring around the focused field.

The interest invoker system has two parts: an invoker element with the interestfor attribute, and a target element it references. When a user shows interest in the invoker (by hovering or focusing), both elements can be styled:

  • :interest-source matches the element with the interestfor attribute when it’s receiving interest
  • :interest-target matches the element being referenced when its invoker has interest

Both pseudo-classes support functional syntax with partial or total parameters. Partial interest means the user has focused the element but hasn’t activated it (like hovering), while total interest means full activation (like clicking).

Basic Interest Example

I respond to the button

How it works

/* Style the invoker when showing interest */
:interest-source {
  background-color: var(--tint);
}

/* Style the target when its invoker has interest */
:interest-target {
  border-color: var(--fg);
  background-color: var(--tint);
  color: var(--fg);
}

Traditional CSS requires elements to be in specific DOM relationships (parent-child, siblings) to affect each other’s styles. Interest invokers break that limitation—any element can invoke interest in any other element via IDREF.

The HTML uses the interestfor attribute to establish the connection:

<button interestfor="tooltip-1">Hover me</button>
<div id="tooltip-1">Tooltip content</div>

Then CSS can style both the invoker and target. --tint and --fg are this site’s fill and text colors, the ones the demos use:

/* Style the button when showing interest */
:interest-source {
background-color: var(--tint);
}
/* Style the tooltip when its invoker has interest */
:interest-target {
opacity: 1;
visibility: visible;
}

One of the most common use cases is creating connected tooltips without JavaScript. When you hover over a button or link, you want to show additional information elsewhere on the page. The interest pseudo-classes make this trivial.

Connected Tooltips

Save your changes (Ctrl+S)
Copy to clipboard (Ctrl+C)
Share with others

CSS with interest pseudo-classes

/* Show tooltip when its invoker has interest */
:interest-target {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

Another powerful use case is highlighting navigation items when their corresponding sections are in view or being interacted with. This creates a connected experience where different parts of your interface respond to user attention.

Interactive Navigation

Home

Welcome to the home section

About

Learn more about us

Services

Our services overview

Contact

Get in touch with us

Navigation highlighting

/* Highlight nav item when it has interest */
:interest-source {
  background-color: var(--tint);
  color: var(--fg);
}

Form Field Relationships

Forms often have helper text, validation messages, or related inputs that should respond to focus on specific fields. Interest pseudo-classes make these relationships explicit and maintainable.

Form with Contextual Helpers

We'll never share your email

Must be at least 8 characters

Choose a unique username

Form field relationships

/* Highlight input when focused */
:interest-source {
  border-color: var(--fg);
  box-shadow: 0 0 0 2px color-mix(in oklch, var(--fg) 20%, transparent);
}

/* Style helper text when input has interest */
:interest-target {
  color: var(--fg);
  transform: translateY(0);
}

Browser Support and Fallbacks

These pseudo-classes were accepted by the CSS Working Group in July 2025. Chrome 139+ has experimental support behind a flag. The proposal is part of the Open UI initiative, not CSS Selectors Level 5. For production use, you’ll need JavaScript fallbacks or progressive enhancement until browser support matures.

You can detect support using CSS @supports:

@supports selector(:interest-source) {
/* Your interest pseudo-class styles */
}

The examples on this page use JavaScript to simulate the behavior until browsers ship support.

The CSS Working Group accepted the :interest-source and :interest-target proposal in July 2025, marking a significant step toward declarative interactive UI in CSS. Chrome 139+ already has experimental support, and the Open UI initiative is actively working to standardize these patterns across all browsers.

The proposal also includes plans for additional functionality, like the interest-delay-start and interest-delay-end CSS properties to control timing, and a potential possible parameter (currently deferred) for handling focusability edge cases.


Trevor I. Lasn

Trevor I. Lasn

Building whiteheap.com and 0xinsider.com.



Related Articles

Check out these related articles that might be useful for you. They cover similar topics and provide additional insights.

CSS
4 min read

CSS nesting is finally supported in all major browsers. Write cleaner, organized stylesheets without Sass or Less

Dec 6, 2024
Read article
CSS
8 min read

Create animated transitions between different states of your app without complex animation libraries.

Nov 11, 2025
Read article
CSS
3 min read

Transform your CSS with :has(), the game-changing selector that finally lets us style elements based on their children.

Dec 4, 2024
Read article
CSS
3 min read

Use CSS @supports to check whether a browser supports a feature such as grid, and give other browsers a fallback. How it works, with multiple conditions.

Dec 6, 2024
Read article
CSS
7 min read

The CSSOM, or CSS Object Model, is the browser's map of every style rule. How it is built beside the DOM, how it computes styles, and how to keep it fast.

Oct 25, 2024
Read article
CSS
4 min read

How to implement the Open-Dyslexic font to enhance readability for users with dyslexia

Oct 12, 2024
Read article
CSS
3 min read

A look at how browsers can highlight text fragments using CSS ::target-text, making text sharing and navigation more user-friendly

Dec 17, 2024
Read article
CSS
3 min read

Use scrollbar-width to thin or hide scrollbars and scrollbar-gutter to prevent layout shift. Browser support, examples, and gotchas.

Dec 19, 2024
Read article
CSS
3 min read

The new pseudo-classes :user-valid and :user-invalid give us a smarter way to style form validation states based on user interaction

Dec 12, 2024
Read article

This article was originally published on https://www.trevorlasn.com/blog/css-interest-pseudo-classes. It was written by a human and polished using grammar tools for clarity.