It can replace foliate-js's overlayer. But there are a couple of drawbacks:
The properties that can be used are the same as those of ::selection. So basically only color and background color. Supposedly text-decoration should also work, but not in WebKit and Firefox yet, it seems.
Overlapping highlights can't be overlaid. Only one style will win, depending on the priority.
Not supported in Firefox yet, though implementation seems to be in progress in Nightly.
It's probably a good fit for search highlighting. Less so for annotations, at least not until text-decoration is supported.
https://developer.mozilla.org/en-US/docs/Web/API/CSS_Custom_Highlight_API
It can replace foliate-js's overlayer. But there are a couple of drawbacks:
::selection
. So basically only color and background color. Supposedlytext-decoration
should also work, but not in WebKit and Firefox yet, it seems.It's probably a good fit for search highlighting. Less so for annotations, at least not until
text-decoration
is supported.