praneshr / react-diff-viewer

A simple and beautiful text diff viewer component made with Diff and React.
https://praneshravi.in/react-diff-viewer/
MIT License
1.43k stars 271 forks source link

Can inline styles be supported? #158

Open liuyib opened 2 years ago

liuyib commented 2 years ago

Firstly, react-diff-viewer inserts the <style> tag to render CSS styles, but in some cases (such as Micro-Frontends, I'm using qiankun framework), the code styles will be lost:

image

So I think above problem can be solved by inline CSS styles, or put the styles to .css file. This is a valid guess, for example, react-codemirror2 with similar functions is put CSS styles to .css files, and its style is normal.

image

Totally, I hope react-diff-viewer can support multiple way to render CSS styles, instead of only <style> tag.

VladyslavKvaskov commented 1 year ago

I have encountered the same problem. I have a little solution in my issue

https://github.com/praneshr/react-diff-viewer/issues/181