Adapt tab-bar/tab-line faces to dark background mode (bug#80135)

* lisp/faces.el (tab-bar, tab-line): Adapt to dark background.
Suggested by Philip Kaludercic <philipk@posteo.net>.

* lisp/tab-bar.el (tab-bar-tab, tab-bar-tab-inactive, tab-bar-tab-highlight):
* lisp/tab-line.el (tab-line-tab, tab-line-tab-inactive)
(tab-line-tab-current, tab-line-highlight): Adapt faces to dark background.
This commit is contained in:
Juri Linkov 2026-01-11 20:58:28 +02:00
parent 990ef36510
commit 762902c2c6
3 changed files with 41 additions and 10 deletions

View file

@ -2963,10 +2963,14 @@ Note: Other faces cannot inherit from the cursor face."
:group 'basic-faces)
(defface tab-bar
'((((class color) (min-colors 88))
'((((class color) (min-colors 88) (background light))
:inherit variable-pitch
:background "grey85"
:foreground "black")
(((class color) (min-colors 88) (background dark))
:inherit variable-pitch
:background "grey20"
:foreground "white")
(((class mono))
:background "grey")
(t
@ -2976,11 +2980,16 @@ Note: Other faces cannot inherit from the cursor face."
:group 'basic-faces)
(defface tab-line
'((((class color) (min-colors 88))
'((((class color) (min-colors 88) (background light))
:inherit variable-pitch
:height 0.9
:background "grey85"
:foreground "black")
(((class color) (min-colors 88) (background dark))
:inherit variable-pitch
:height 0.9
:background "grey20"
:foreground "white")
(((class mono))
:background "grey")
(t

View file

@ -48,8 +48,12 @@
(defface tab-bar-tab
'((default
:inherit tab-bar)
(((class color) (min-colors 88))
(((class color) (min-colors 88) (background light))
:box (:line-width 1 :style released-button))
(((class color) (min-colors 88) (background dark))
:box (:line-width 1 :style released-button)
:background "grey40"
:foreground "white")
(t
:inverse-video nil))
"Tab bar face for selected tab."
@ -59,8 +63,10 @@
(defface tab-bar-tab-inactive
'((default
:inherit tab-bar-tab)
(((class color) (min-colors 88))
(((class color) (min-colors 88) (background light))
:background "grey75")
(((class color) (min-colors 88) (background dark))
:background "grey20")
(t
:inverse-video t))
"Tab bar face for non-selected tab."
@ -86,10 +92,14 @@
:group 'tab-bar-faces)
(defface tab-bar-tab-highlight
'((((class color) (min-colors 88))
'((((class color) (min-colors 88) (background light))
:box (:line-width 1 :style released-button)
:background "grey85"
:foreground "black")
(((class color) (min-colors 88) (background dark))
:box (:line-width 1 :style released-button)
:background "grey40"
:foreground "white")
(t :inverse-video nil))
"Tab bar face for highlighting."
:version "31.1"

View file

@ -62,8 +62,12 @@ is selected."
(defface tab-line-tab
'((default :inherit tab-line)
(((class color) (min-colors 88))
(((class color) (min-colors 88) (background light))
:box (:line-width 1 :style released-button))
(((class color) (min-colors 88) (background dark))
:box (:line-width 1 :style released-button)
:background "grey40"
:foreground "white")
(t :inverse-video nil))
"Tab line face for selected tab."
:version "27.1"
@ -71,8 +75,10 @@ is selected."
(defface tab-line-tab-inactive
'((default :inherit tab-line-tab)
(((class color) (min-colors 88))
(((class color) (min-colors 88) (background light))
:background "grey75")
(((class color) (min-colors 88) (background dark))
:background "grey20")
(t :inverse-video t))
"Tab line face for non-selected tab."
:version "27.1"
@ -115,17 +121,23 @@ function `tab-line-tab-face-group'."
(defface tab-line-tab-current
'((default :inherit tab-line-tab)
(((class color) (min-colors 88))
:background "grey85"))
(((class color) (min-colors 88) (background light))
:background "grey85")
(((class color) (min-colors 88) (background dark))
:background "grey40"))
"Tab line face for tab with current buffer in selected window."
:version "27.1"
:group 'tab-line-faces)
(defface tab-line-highlight
'((((class color) (min-colors 88))
'((((class color) (min-colors 88) (background light))
:box (:line-width 1 :style released-button)
:background "grey85"
:foreground "black")
(((class color) (min-colors 88) (background dark))
:box (:line-width 1 :style released-button)
:background "grey40"
:foreground "white")
(t :inverse-video nil))
"Tab line face for highlighting."
:version "27.1"