Highlighting a range of text inside a form field. @Olliew shows how the new Opaq...

@webstandards_dev@mastodon.social

Highlighting a range of text inside a form field. @Olliew shows how the new OpaqueRange extends the CSS Custom Highlight API into form controls. Call createValueRange() on a <textarea> or on a text, password, search, tel, or url <input>, pass the result into a Highlight(), and register it with CSS.highlights.set(). In ::highlight() you get color, background-color, text-decoration, and text-shadow. Chromium 152 only for now. #chrome #js

olliewilliams.xyz/blog/opaquer