Re: [csswg-drafts] CSS syntax highlighting proposal (#9247)

I don't think this is not the appropriate level of abstraction for CSS. Do note that there is the [CSS Custom Highlight API](https://developer.mozilla.org/en-US/docs/Web/API/CSS_Custom_Highlight_API), which is very similar to what you're describing here, but covers more broad use cases than syntax highlighting. In fact, we (Prism) are considering using once it gets Baseline browser support, though not sure we'd use it as a default.

Though do note that something like this does limit what you can do with syntax highlighting compared to the current approach. E.g. these Prism plugins would not be possible if we used the CSS Custom Highlight API:
- https://prismjs.com/plugins/autolinker/
- https://prismjs.com/plugins/inline-color/ (unless we allow generated content on `::highlight()`, or expand to more properties)
- https://prismjs.com/plugins/previewers/

Which might be an acceptable tradeoff, but something to have in mind.

-- 
GitHub Notification of comment by LeaVerou
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9247#issuecomment-1694405797 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Saturday, 26 August 2023 16:36:32 UTC