# theme: Expose editor diff hunk colors \(\#51784\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/fb3218e01e22d5dcc2791fd6b94d22cf37d8e42f)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: fb3218e01e22d5dcc2791fd6b94d22cf37d8e42f

Requested commit: fb3218e01e22d5dcc2791fd6b94d22cf37d8e42f

Commit: fb3218e01e22d5dcc2791fd6b94d22cf37d8e42f

Tree: 2c4fc73b6b6620cff24c0e3240090718941ca16f

Author: Vitaly Slobodin

Committer: GitHub

## Message

```
theme: Expose editor diff hunk colors (#51784)

This PR makes editor diff hunk colors configurable from themes, instead
of hardcoded values.

It introduces 6 new optional theme keys:

- `editor.diff_hunk.added.background`
- `editor.diff_hunk.added.hollow_background`
- `editor.diff_hunk.added.hollow_border`
- `editor.diff_hunk.deleted.background`
- `editor.diff_hunk.deleted.hollow_background`
- `editor.diff_hunk.deleted.hollow_border`

When a theme omits these keys, each color falls back to the existing
version-control color with the previous hardcoded opacity values:

- Light defaults:
  - background_opacity = 0.16
  - hollow_background_opacity = 0.08
  - hollow_border_opacity = 0.48
- Dark defaults:
  - background_opacity = 0.12
  - hollow_background_opacity = 0.06
  - hollow_border_opacity = 0.36

There is an existing feature request
https://github.com/zed-industries/zed/discussions/51667

## Screenshots

I used `Modus Themes` (Modus Vivendi) since these themes provide highly
accessible themes.

Original version:

<img width="3248" height="2120" alt="CleanShot 2026-03-17 at 20 26
41@2x"
src="https://github.com/user-attachments/assets/730be802-835d-436e-a1fc-4c60dcb5fce8"
/>

This version:

<img width="3248" height="2120" alt="CleanShot 2026-03-17 at 20 23
09@2x"
src="https://github.com/user-attachments/assets/785c86d3-147e-437f-9624-9576bc201551"
/>

Before you mark this PR as ready for review, make sure that you have:

- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- Added theme keys for configuring editor diff hunk colors.

---------

Co-authored-by: MrSubidubi <finn@zed.dev>
```

## Parents

- [4339b65ce61955c3c0675cd90e82010891d9bd9a](https://git.cafe/gitcafe/zed/commit/4339b65ce61955c3c0675cd90e82010891d9bd9a?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/fb3218e01e22d5dcc2791fd6b94d22cf37d8e42f?format=markdown)
