5.28 Add support for solaire-mode

The ‘solaire-mode’ package dims the background of what it considers ancillary “UI” buffers, such as the minibuffer and Dired buffers. The Modus themes used to support Solaire on the premise that the user was (i) opting in to it, (ii) understood why certain buffers were more gray, and (iii) knew what other adjustments had to be made to prevent broken visuals (e.g. the default style of the modus-themes-completions uses a subtle gray background for the selection, which with Solaire becomes practically invisible).

However, the assumption that users opt in to this feature does not always hold true. There are cases where it is enabled by defaultsuch as in the popular Doom Emacs configuration. Thus, the unsuspecting user who loads modus-operandi or modus-vivendi without the requisite customizations is getting a sub-par experience; an experience that we did not intend and cannot genuinely fix.

Because the Modus themes are meant to work everywhere, we cannot make an exception for Doom Emacs and/or Solaire users. Furthermore, we shall not introduce hacks, such as by adding a check in all relevant faces to be adjusted based on Solaire or whatever other package. Hacks of this sort are unsustainable and penalize the entire userbase. Besides, the themes are built into Emacs and we must keep their standard high.

The fundamental constraint with Solaire is that Emacs does not have a real distinction between “content” and “UI” buffers. For themes to work with Solaire, they need to be designed around that package. Such is an arrangement that compromises on our accessibility standards and/or hinders our efforts to provide the best possible experience while using the Modus themes.

As such, ‘solaire-mode’ is not—and will not be—supported by the Modus themes (or any other of my themes, for that matter). Users who want it must style the faces manually. Below is some sample code, based on what we cover at length elsewhere in this manual:

Advanced customization.

Face specs at scale using the themes’ palette.

(defun my-modus-themes-custom-faces ()
  (modus-themes-with-colors
    (custom-set-faces
     `(solaire-default-face ((,class :inherit default :background ,bg-alt :foreground ,fg-dim)))
     `(solaire-line-number-face ((,class :inherit solaire-default-face :foreground ,fg-unfocused)))
     `(solaire-hl-line-face ((,class :background ,bg-active)))
     `(solaire-org-hide-face ((,class :background ,bg-alt :foreground ,bg-alt))))))

(add-hook 'modus-themes-after-load-theme-hook #'my-modus-themes-custom-faces)

As always, re-load the theme for changes to take effect.