Skip to content

Commit 4a640b9

Browse files
Merge branch 'main' of github.com:MicrosoftEdge/Demos
2 parents e8adfb3 + 7cef7ad commit 4a640b9

File tree

3 files changed

+646
-0
lines changed

3 files changed

+646
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# CSS Custom Highlight highlightsFromPoint() API demo
2+
3+
➡️ **[Open the demo](https://microsoftedge.github.io/Demos/custom-highlight-api/highlightsFromPoint)** ⬅️
4+
5+
The [Custom Highlight API](https://www.w3.org/TR/css-highlight-api-1/) provides a programmatic way of adding and removing highlights that do not affect the underlying DOM structure, but instead applies styles to text based on range objects, accessed via the `::highlight()` pseudo element.
6+
7+
The [`highlightsFromPoint(x, y, options)`](https://drafts.csswg.org/css-highlight-api-1/#dom-highlightregistry-highlightsfrompoint) method allows developers to build scenarios involving user interaction with custom highlights. It returns an array of objects representing the custom highlights applied at a specific point within the viewport.

0 commit comments

Comments
 (0)