Hacker News new | ask | show | jobs
by tumultco 1460 days ago
Thanks for your work in developing this!

Does Lexical have a feature to set arbitrary CSS on a particular selection range? I've been looking for a solution to do this since the WebKit's -[WebView applyStyle:] is deprecated as part of WebView Legacy. It isn't clear to me from glancing at the docs if RangeSelection.formatText() or other methods can handle anything or just a subset of styling code. Thanks!

2 comments

Yes, we have something like this in @lexical/selection: https://github.com/facebook/lexical/blob/af099ffd9f464b523d6...
Just mentioning SlateJS which has [decorations](https://docs.slatejs.org/concepts/09-rendering#decorations) for this