rtfpessoa / diff2html

Pretty diff to html javascript library (diff2html)
https://diff2html.xyz
MIT License
2.94k stars 281 forks source link

Add support for dark mode #403

Closed mystiquewolf closed 1 year ago

mystiquewolf commented 3 years ago

Step -1: Before filling an issue check out troubleshooting section

Step 0: Describe your environment

Step 1: Describe the problem:

Feature request: Add support for dark mode via parameter and via prefers-color-scheme. Not sure if the latter can be done at this project or projects that use this project should detect the environment in some way and pass parameters.

Observed Results:

Dark mode not available in VS Code Diff viewer extension. https://github.com/caponetto/vscode-diff-viewer/issues/36

Expected Results:

rtfpessoa commented 3 years ago

This should not be hard to implement, is mostly a matter of doing some CSS work and making it work with the dark highlight.js themes. Feel free to send a PR.

Angelk90 commented 2 years ago

@mystiquewolf , @rtfpessoa : Are there any news?

If I put a background for example dark to the body this happens.

Schermata 2022-03-08 alle 19 36 16
mystiquewolf commented 2 years ago

No news from me for now, i'm busy with other things, don't use this very frequently yet and lately I'm using light themes.

Angelk90 commented 2 years ago

We hope @rtfpessoa can solve the problem.

rtfpessoa commented 2 years ago

No news on my side. It will probably need some more tweaks to work. Feel free to send a PR

ananyf commented 2 years ago

Hello @rtfpessoa Can you use this lib https://darkmodejs.learn.uno/

rtfpessoa commented 2 years ago

That does not seem like a great solution. The solution should be done at the css level of this project.

rtfpessoa commented 1 year ago

I have no time to put on this, but if you are interested in working on a PR, feel free to ask for any guidance and I will help.

JHWelch commented 1 year ago

I've been working on this with a straight CSS solution, other than passing a config value to indicate light/dark/auto switch. I'm making progress, hopefully I should have a PR up relatively soon.

bombillazo commented 1 year ago

Thanks for this feature!