Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider the CSS Custom Highlight API #21

Open
johnfactotum opened this issue Apr 19, 2024 · 0 comments
Open

Consider the CSS Custom Highlight API #21

johnfactotum opened this issue Apr 19, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@johnfactotum
Copy link
Owner

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:

  • 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.

@johnfactotum johnfactotum added the enhancement New feature or request label Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant