Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / CSS

:interest-source — the current interest source

The :interest-source pseudo-class selects a source the user is currently showing interest in, not every element with interestfor.

Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required

Syntax

:interest-source

:interest-source is an argument-free pseudo-class in the Selectors Level 5 draft. It matches the source of current user interest. The interestfor attribute alone is insufficient. :interest-target selects the associated target.

The document language defines sources, associations, and gestures. Interest may arise from hovering, focusing, or long-pressing; it does not mean ordinary click activation. Do not treat this pseudo-class as a replacement for :hover.

The example changes the source border from gray to blue. Reactions may be delayed; CSS UI defines interest-delay-* properties. This is a draft feature: check both selector support and interestfor interaction in the target browser. The example has not been executed.

Examples

<!doctype html>
<meta charset="utf-8">
<title>:interest-source</title>
<style>
  button { border: 3px solid gray; }
  button:interest-source { border-color: blue; }
</style>
<button interestfor="info">Info</button>
<div id="info" popover>Additional information</div>

Result

Initially: gray button border. While the button matches :interest-source: blue button border. Requires support for the selector and the interestfor interaction.

The example was not run. In a browser that supports both `:interest-source` and `interestfor` interaction, the button’s border is expected to be gray initially and blue while the button matches `:interest-source`.

Sources