Skip to content

DIY Make the tab bar more or less colorful

This is one of our practical examples to override the semantic colors of the Modus themes (Stylistic variants using palette overrides). Here we show how to affect the colors of the built-in tab-bar-mode and tab-line-mode.

For consistent theme-wide results, consider changing the mode line, fringes, and line numbers. These are shown in other sections of this manual.

emacs-lisp
;; Make the `tab-bar-mode' mode subtle while keepings its original
;; gray aesthetic.
(setq modus-themes-common-palette-overrides
      '((bg-tab-bar bg-main)
        (bg-tab-current bg-active)
        (bg-tab-other bg-dim)))

;; Like the above, but the current tab has a colorful background and
;; the inactive tabs have a slightly more noticeable gray background.
(setq modus-themes-common-palette-overrides
      '((bg-tab-bar bg-main)
        (bg-tab-current bg-cyan-intense)
        (bg-tab-other bg-inactive)))

;; Make the tabs colorful, using a monochromatic pattern (e.g. shades
;; of cyan).
(setq modus-themes-common-palette-overrides
      '((bg-tab-bar bg-cyan-nuanced)
        (bg-tab-current bg-cyan-intense)
        (bg-tab-other bg-cyan-subtle)))

;; Like the above, but with a dichromatic pattern (cyan and magenta).
(setq modus-themes-common-palette-overrides
      '((bg-tab-bar bg-cyan-nuanced)
        (bg-tab-current bg-magenta-intense)
        (bg-tab-other bg-cyan-subtle)))

Reload the theme for changes to take effect.