reddit / emacs

Customizing Background Color of Tab Bar

ExistingProgram3883 · 2022-04-24 09:27
Hi redditors, has anybody accomplished customizing the background color of the tab-bar on Emacs 29.0.50? I tried to achieve this both via theme customization and `gtk.css`, but did not succeed. Can anybody help? (BTW: I am using the modus-themes) Thanks in advance!
mclearc · 2022-04-24 15:10
You need to customize the faces. For example (from my own [Lambda-themes](https://github.com/Lambda-Emacs/lambda-themes)): ```emacs-lisp ;;;;;; Tab-bar `(tab-bar ((,class (:background ,lambda-bg :foreground ,lambda-meek :height 1.0 :box (:line-width -1 :color ,lambda-bg))))) `(tab-bar-tab ((,class (:background ,lambda-ultralight :foreground ,lambda-fg :height 1.05)))) `(tab-bar-tab-inactive ((,class (:background ,lambda-lowlight :foreground ,lambda-meek :height .95)))) `(tab-bar-tab-ungrouped ((,class (:background ,lambda-bg :foreground ,lambda-faint)))) `(tab-bar-tab-group-current ((,class (:background ,lambda-bg :foreground ,lambda-fg :underline t)))) `(tab-bar-tab-group-inactive ((,class (:background ,lambda-bg :foreground ,lambda-faint)))) ``` You might see how these are set in modus-themes and customize from there. If you're unfamiliar with customizing a theme look at the info guide for [custom themes](https://www.gnu.org/software/emacs/manual/html_node/elisp/Custom-Themes.html), especially `custom-theme-set-faces`. If you use use-package, there is an [easy way to do that](https://github.com/jwiegley/use-package#customizing-faces) with the `custom-face` keyword. EDIT: I should also mention that whatever customizations you make should be loaded *after* your theme (whether that is modus-themes or something else) so as not to be overriden by it.
ExistingProgram3883 · 2022-04-24 16:05
Thanks for your hint and the note on your lambda-themes. Basically, I it was super simple to change the given colors. I just didn't look deep enough into the theme's docu. ``` (setq modus-themes-vivendi-color-overrides '((bg-main . "#101010") (bg-active . "#202020") (bg-tab-active . "#606060") (bg-tab-inactive . "#303030") (fg-main . "#c2c2c2"))) ``` Thanks again!
mclearc · 2022-04-24 16:21
yeah - glad you found a fix!
00-11 · 2022-04-24 21:10
Ask Emacs: * `M-x list-faces-display` * `M-x customize-face t a b TAB`
ExistingProgram3883 · 2022-04-25 05:47
Thanks for the hint! Since the tab-bar had the _exact_ same color as the window borders of my DE, I was tricked to follow the wrong path and suspected, that I had to style it via a `gtk.css` as one would do with the menu-bar. Turned out so much easier -- especial with u/mclearc's and your help.