Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Needs theme with no background color #7

Open
Cretezy opened this issue May 2, 2021 · 8 comments
Open

Needs theme with no background color #7

Cretezy opened this issue May 2, 2021 · 8 comments

Comments

@Cretezy
Copy link

Cretezy commented May 2, 2021

I use a black background in my terminal, and the "dark" themes aren't really enough. Either having a black theme or one without background color (meaning using the terminal's background) would be ideal.

Great project!

@controversial
Copy link

Second this. I use a terminal with a translucent background:

Screen Shot 2021-05-01 at 8 26 09 PM

however, git-split-diffs adds an opaque background behind every character on the screen:

Screen Shot 2021-05-01 at 8 28 28 PM

It would be great if there were an option to render a theme without any background color on the non-highlighted lines (obviously, the lines highlighted as added or removed need to have a background color)

@banga
Copy link
Owner

banga commented May 2, 2021

Makes sense. The reason everything has a background is because I added support for alpha in colors, so that you could say e.g. line deletions are ff000022 which adds a reddish tinge to the background. This is especially useful if you have multiple layers like for highlighting inline changes.

Anyway, will think of a fix. Would you rather have a way to unset background colors in existing themes, or just have a separate theme without backgrounds? I'm guessing the former would be better so you can use any theme

@Cretezy
Copy link
Author

Cretezy commented May 2, 2021

Alternatively, a way to point to a custom .json theme file, so everyone can be happy 😃

@banga
Copy link
Owner

banga commented May 2, 2021

Oh yeah that might be better. You can hackishly do that right now by making theme-name a relative path, but there should be a better way

@controversial
Copy link

I hacked together a quick fix in #8!

@banga
Copy link
Owner

banga commented Sep 21, 2024

I just published v2.2.0 which adds support for using custom themes. The instructions are at https://github.com/banga/git-split-diffs/tree/v2.2.0?tab=readme-ov-file#custom-themes and https://github.com/banga/git-split-diffs/tree/v2.2.0?tab=readme-ov-file#want-to-remove-background-colors-from-a-theme. So far from personal usage, just removing backgroundColor seems to be enough, but let me know what you all think.

@Yukaii
Copy link

Yukaii commented Sep 24, 2024

I'm getting the following error when "SYNTAX_HIGHLIGHTING_THEME": "my-custom-theme-name", is set in my custom theme JSON. I currently use theme names from shikijs to workaround this issue

ShikiError: Theme `my-custom-theme-name` is not included in this bundle. You may want to load it from external source.

@banga
Copy link
Owner

banga commented Sep 26, 2024

Yeah to be clear, I've only added support to use custom themes for git-split-diffs. Syntax highlighting happens via shikijs which has its own themes. I'll look into it though, should be easy to add. It would actually be nice to have a way to just use a shikijs theme and derive all the colors from it for git-split-diffs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants