protesilaos / modus-themes

Highly accessible themes for GNU Emacs, conforming with the highest standard for colour contrast between background and foreground values (WCAG AAA).
https://protesilaos.com/emacs/modus-themes
GNU General Public License v3.0
553 stars 30 forks source link

How to customize breadcrumb header line from eglot? #104

Open garyo opened 4 months ago

garyo commented 4 months ago

Here's a screenshot of eglot in a shell-mode buffer. I'd like to customize the header or breadcrumb line at the top. Since I can't set point on that line, I can't run C-u M-x = to see what faces it uses.

image

Is there any way with modus themes to make that header line larger, with a different font, and maybe a more intense background color? To be clear, the header line I'm talking about is at the very top, beginning with "openfx/scripts/build-cmake.sh :". The text there comes from eglot or some related package; it's not part of the buffer text.

protesilaos commented 4 months ago

Hello @garyo! The face for the entire line is header-line. For the others, we have:

Is there any way with modus themes to make that header line larger, with a different font, and maybe a more intense background color?

Based on some of the examples from the manual:

(defun my-modus-themes-faces (&rest _)
  (modus-themes-with-colors
    (set-face-attribute 'header-line nil :height 1.2 :background bg-inactive) ; or use bg-active for more intensity
    ;; Add more face customisations here
    ))

(add-hook 'enable-theme-functions #'my-modus-themes-faces)

;; Other customisations here

;; The code that loads your theme here

Notice that I set the :height to 1.2 times the size of the base font size. Tweak that accordingly.

For a more systematic approach to font configurations, check my fontaine package.

garyo commented 4 months ago

I see; that's helpful. Your package is very deep; still learning! I settled on this style, which doesn't need to use the hook:

(use-package modus-themes
  :ensure t
  :init
  (setq modus-vivendi-palette-overrides
        '(
          (bg-mode-line-active bg-blue-subtle)
          (border-mode-line-inactive bg-mode-line-inactive)
          (bg-removed "#661119") ; more visible to me vs. green bg-added color
          )
        modus-themes-italic-constructs t ; italic comments, doc strings
        )
  :config
  (load-theme 'modus-vivendi)           ; dark theme
  ;; customize header line format (do this after loading theme)
  (modus-themes-with-colors
    (set-face-attribute 'header-line nil :height 1.15 :underline t :background bg-active))
  )
garyo commented 4 months ago

Ah, I see why the hook is needed. Without it, switching to a different theme and back loses the customizations.

(use-package modus-themes
  :init
  (setq modus-vivendi-palette-overrides
        '(
          (bg-mode-line-active bg-blue-subtle)
          (border-mode-line-inactive bg-mode-line-inactive)
          (bg-removed "#661119") ; more visible to me vs. green bg-added color
          )
        modus-themes-italic-constructs t ; italic comments, doc strings
        )
  :config
  ;; customize header line format
  (defun customize-theme-faces (&rest _)
    (modus-themes-with-colors
      (set-face-attribute 'header-line nil :height 1.15 :underline t :background bg-active))
    )
  (add-hook 'enable-theme-functions #'customize-theme-faces)

  (load-theme 'modus-vivendi)           ; dark theme
  )