The CSS Custom Highlight API allows us to easily add style to a text range. As of this writing, this feature is still in Working Draft, so it is subject to change. This feature does not currently work on Firefox, so you shouldn’t use it for production right now if Firefox is necessary.

15m read timeFrom blog.logrocket.com
Post cover image
Table of contents
Understanding the basicsOver 200k developers use LogRocket to create better digital experiencesCreating and highlighting more complex rangesHandling accessibility limitationsCSS custom highlight API examplesFinal thoughtsIs your frontend hogging your users' CPU?

Sort: