Variable: auto-dark-themes

auto-dark-themes is a customizable variable defined in auto-dark.el.

Value

nil

Documentation

The themes to enable for dark and light modes.

The default is to use the themes in custom-enabled-themes, but that only works if the themes are aware of frame-background-mode, which many aren’t.

If your themes aren’t aware of frame-background-mode (or you just prefer different themes for dark and light modes), you can set explicit lists of themes for each mode. Like with custom-enabled-themes, the earlier themes in the list have higher precedence.

One other thing to be aware of is that when you first load a theme, you may be prompted to acknowledge that the theme can run arbitrary Lisp code. Acknowledging this and then allowing Emacs to treat the theme as safe in future sessions will silence the prompt (for that particular theme). If you would just prefer to ignore this warning for all themes, you can set custom-safe-themes to t.

This variable was added, or its default value changed, in Emacs 0.13.

Source Code

;; Defined in /nix/store/fxsazwcy8jcsigjhcydkb81ip47xqcw0-emacs-packages-deps/share/emacs/site-lisp/elpa/auto-dark-20260313.2356/auto-dark.el
;; Dark & light themes need to be set together because enabling and disabling
;; themes modifies `custom-enabled-themes', so if only one mode were expected to
;; default to `custom-enabled-themes', it would use the wrong list of themes
;; after the first time the other mode enables its themes.
(defcustom auto-dark-themes nil
  "The themes to enable for dark and light modes.
The default is to use the themes in `custom-enabled-themes', but that only works
if the themes are aware of `frame-background-mode', which many aren’t.

If your themes aren’t aware of `frame-background-mode' (or you just prefer
different themes for dark and light modes), you can set explicit lists of themes
for each mode. Like with `custom-enabled-themes', the earlier themes in the list
have higher precedence.

One other thing to be aware of is that when you first load a theme, you may be
prompted to acknowledge that the theme can run arbitrary Lisp code.
Acknowledging this and then allowing Emacs to treat the theme as safe in future
sessions will silence the prompt (for that particular theme). If you would just
prefer to ignore this warning for all themes, you can set `custom-safe-themes'
to t."
  :group 'auto-dark
  :type '(choice
          (const :tag "Use custom-enabled-themes" nil)
          (list :tag "Use distinct dark & light lists"
                (repeat :tag "Dark" symbol)
                (repeat :tag "Light" symbol)))
  :set (lambda (symbol value)
         ;; Pre-load themes so that:
         ;; 1. `custom-safe-themes’ prompts happen here (during
         ;;    customization) rather than at init or mode-switch
         ;;    time (#64, #67, #82).
         ;; 2. `auto-dark--enable-themes’ can later use the fast
         ;;    `enable-theme’ path instead of `load-theme’.
         ;; We check `theme-settings’ instead of `custom-theme-p’
         ;; because some theme libraries (e.g. modus-themes v5)
         ;; eagerly declare all their themes at `require’-time
         ;; without loading them, which would cause this pre-load
         ;; to be skipped (#96).
         (mapc (lambda (mode-themes)
                 (mapc (lambda (theme)
                         (unless (get theme 'theme-settings)
                           (load-theme theme nil t)))
                       mode-themes))
               value)
         (set-default symbol value)
         (when auto-dark-mode
           ;; Make sure Auto Dark is showing the updated themes for the current
           ;; ‘frame-background-mode’.
           (auto-dark--check-and-set-dark-mode)))
  :version "0.13")