branch: externals/modus-operandi-theme
commit a5f4ecea5a6125c54ba9743719b0e639ade32689
Author: Protesilaos Stavrou <[email protected]>
Commit: Protesilaos Stavrou <[email protected]>
Refinements for MAGIT/DIFF hunk headers
+ Create a new colour combination that is dedicated to diff headings.
+ Make the context of the focused hunk in Magit a bit more intense (dark
grey for Modus Operandi, lighter for Modus Vivendi). The difference
with the prior shade of grey is small, though noticeable. The idea is
to clearly highlight the extent of the current diff, while still
retaining the contrast with any hunk heading that may follow right
below.
+ Let the unfocused hunk headings in Magit appear less intense by
tweaking their foreground colour.
+ The selection of Magit hunk headings now uses a more intense cyan
background to clearly distinguish this state from the regular view of
a focused hunk heading.
---
modus-operandi-theme.el | 13 ++++++++-----
modus-vivendi-theme.el | 13 ++++++++-----
2 files changed, 16 insertions(+), 10 deletions(-)
diff --git a/modus-operandi-theme.el b/modus-operandi-theme.el
index 3d4904d..2f37a18 100644
--- a/modus-operandi-theme.el
+++ b/modus-operandi-theme.el
@@ -282,6 +282,7 @@ between foreground and background is >= 7:1)."
(defface modus-theme-diff-focus-added nil t)
(defface modus-theme-diff-focus-changed nil t)
(defface modus-theme-diff-focus-removed nil t)
+(defface modus-theme-diff-heading nil t)
;; User-facing customisation options. They are all deactivated by
;; default (users must opt in).
@@ -419,6 +420,7 @@ between foreground and background is >= 7:1)."
(fg-header "#2a2a2a") (bg-header "#e5e5e5")
(fg-whitespace "#645060") (bg-whitespace "#fff8fc")
(fg-paren-match "#222222") (bg-paren-match "#deb8af")
+ (fg-diff-heading "#043355") (bg-diff-heading "#b7c2dd")
(fg-diff-added "#004500") (bg-diff-added "#d4fad4")
(fg-diff-changed "#524200") (bg-diff-changed "#fcefcf")
(fg-diff-removed "#691616") (bg-diff-removed "#ffe8ef")
@@ -497,6 +499,7 @@ between foreground and background is >= 7:1)."
`(modus-theme-diff-focus-added ((,class (:background ,bg-diff-focus-added
:foreground ,fg-diff-focus-added))))
`(modus-theme-diff-focus-changed ((,class (:background
,bg-diff-focus-changed :foreground ,fg-diff-focus-changed))))
`(modus-theme-diff-focus-removed ((,class (:background
,bg-diff-focus-removed :foreground ,fg-diff-focus-removed))))
+ `(modus-theme-diff-heading ((,class (:background ,bg-diff-heading
:foreground ,fg-diff-heading))))
;;;;;;;;;;;;;;;;;;;
;; actual styles ;;
;;;;;;;;;;;;;;;;;;;
@@ -820,7 +823,7 @@ between foreground and background is >= 7:1)."
`(diff-file-header ((,class (:foreground ,blue :weight bold))))
`(diff-function ((,class (:foreground ,fg-special-cold))))
`(diff-header ((,class (:foreground ,blue-nuanced))))
- `(diff-hunk-header ((,class (:inherit modus-theme-subtle-cyan :weight
bold))))
+ `(diff-hunk-header ((,class (:inherit modus-theme-diff-heading :weight
bold))))
`(diff-index ((,class (:foreground ,blue-alt :weight bold))))
`(diff-indicator-added ((,class (:inherit diff-added))))
`(diff-indicator-changed ((,class (:inherit diff-changed))))
@@ -1603,13 +1606,13 @@ between foreground and background is >= 7:1)."
`(magit-diff-base ((,class (:inherit modus-theme-diff-changed))))
`(magit-diff-base-highlight ((,class (:inherit
modus-theme-diff-focus-changed))))
`(magit-diff-context ((,class (:foreground ,fg-alt))))
- `(magit-diff-context-highlight ((,class (:background ,bg-alt :foreground
,fg-alt))))
+ `(magit-diff-context-highlight ((,class (:background ,bg-inactive
:foreground ,fg-inactive))))
`(magit-diff-file-heading ((,class (:foreground ,fg-special-cold :weight
bold))))
`(magit-diff-file-heading-highlight ((,class (:inherit
modus-theme-special-cold :weight bold))))
`(magit-diff-file-heading-selection ((,class (:background ,bg-alt
:foreground ,cyan))))
- `(magit-diff-hunk-heading ((,class (:inherit modus-theme-intense-neutral
:weight bold))))
- `(magit-diff-hunk-heading-highlight ((,class (:inherit
modus-theme-subtle-blue :weight bold))))
- `(magit-diff-hunk-heading-selection ((,class (:inherit
modus-theme-refine-cyan))))
+ `(magit-diff-hunk-heading ((,class (:background ,bg-active :foreground
,fg-inactive :weight bold))))
+ `(magit-diff-hunk-heading-highlight ((,class (:inherit
modus-theme-diff-heading :weight bold))))
+ `(magit-diff-hunk-heading-selection ((,class (:inherit
modus-theme-intense-cyan))))
`(magit-diff-hunk-region ((,class (:weight bold))))
`(magit-diff-lines-boundary ((,class (:background ,fg-main))))
`(magit-diff-lines-heading ((,class (:inherit modus-theme-refine-magenta))))
diff --git a/modus-vivendi-theme.el b/modus-vivendi-theme.el
index 0b5a99f..d4ad0f7 100644
--- a/modus-vivendi-theme.el
+++ b/modus-vivendi-theme.el
@@ -282,6 +282,7 @@ between foreground and background is >= 7:1)."
(defface modus-theme-diff-focus-added nil t)
(defface modus-theme-diff-focus-changed nil t)
(defface modus-theme-diff-focus-removed nil t)
+(defface modus-theme-diff-heading nil t)
;; User-facing customisation options. They are all deactivated by
;; default (users must opt in).
@@ -419,6 +420,7 @@ between foreground and background is >= 7:1)."
(fg-header "#dddddd") (bg-header "#2a2a2a")
(fg-whitespace "#a4959f") (bg-whitespace "#170016")
(fg-paren-match "#fcfcfc") (bg-paren-match "#754a5d")
+ (fg-diff-heading "#dadffe") (bg-diff-heading "#304466")
(fg-diff-added "#94ba94") (bg-diff-added "#002600")
(fg-diff-changed "#b0ba9f") (bg-diff-changed "#2a2000")
(fg-diff-removed "#bbadaa") (bg-diff-removed "#390a0a")
@@ -497,6 +499,7 @@ between foreground and background is >= 7:1)."
`(modus-theme-diff-focus-added ((,class (:background ,bg-diff-focus-added
:foreground ,fg-diff-focus-added))))
`(modus-theme-diff-focus-changed ((,class (:background
,bg-diff-focus-changed :foreground ,fg-diff-focus-changed))))
`(modus-theme-diff-focus-removed ((,class (:background
,bg-diff-focus-removed :foreground ,fg-diff-focus-removed))))
+ `(modus-theme-diff-heading ((,class (:background ,bg-diff-heading
:foreground ,fg-diff-heading))))
;;;;;;;;;;;;;;;;;;;
;; actual styles ;;
;;;;;;;;;;;;;;;;;;;
@@ -820,7 +823,7 @@ between foreground and background is >= 7:1)."
`(diff-file-header ((,class (:foreground ,blue :weight bold))))
`(diff-function ((,class (:foreground ,fg-special-cold))))
`(diff-header ((,class (:foreground ,blue-nuanced))))
- `(diff-hunk-header ((,class (:inherit modus-theme-subtle-cyan :weight
bold))))
+ `(diff-hunk-header ((,class (:inherit modus-theme-diff-heading :weight
bold))))
`(diff-index ((,class (:foreground ,blue-alt :weight bold))))
`(diff-indicator-added ((,class (:inherit diff-added))))
`(diff-indicator-changed ((,class (:inherit diff-changed))))
@@ -1603,13 +1606,13 @@ between foreground and background is >= 7:1)."
`(magit-diff-base ((,class (:inherit modus-theme-diff-changed))))
`(magit-diff-base-highlight ((,class (:inherit
modus-theme-diff-focus-changed))))
`(magit-diff-context ((,class (:foreground ,fg-alt))))
- `(magit-diff-context-highlight ((,class (:background ,bg-alt :foreground
,fg-alt))))
+ `(magit-diff-context-highlight ((,class (:background ,bg-inactive
:foreground ,fg-inactive))))
`(magit-diff-file-heading ((,class (:foreground ,fg-special-cold :weight
bold))))
`(magit-diff-file-heading-highlight ((,class (:inherit
modus-theme-special-cold :weight bold))))
`(magit-diff-file-heading-selection ((,class (:background ,bg-alt
:foreground ,cyan))))
- `(magit-diff-hunk-heading ((,class (:inherit modus-theme-intense-neutral
:weight bold))))
- `(magit-diff-hunk-heading-highlight ((,class (:inherit
modus-theme-subtle-blue :weight bold))))
- `(magit-diff-hunk-heading-selection ((,class (:inherit
modus-theme-refine-cyan))))
+ `(magit-diff-hunk-heading ((,class (:background ,bg-active :foreground
,fg-inactive :weight bold))))
+ `(magit-diff-hunk-heading-highlight ((,class (:inherit
modus-theme-diff-heading :weight bold))))
+ `(magit-diff-hunk-heading-selection ((,class (:inherit
modus-theme-intense-cyan))))
`(magit-diff-hunk-region ((,class (:weight bold))))
`(magit-diff-lines-boundary ((,class (:background ,fg-main))))
`(magit-diff-lines-heading ((,class (:inherit modus-theme-refine-magenta))))