Skip to content

Help users adapt faces of packages not covered by nord-emacs #118

@c-alpha

Description

@c-alpha

When using an Emacs theme, there will inevitably be packages in my configuration which are not covered by the theme. To get a uniform look&feel, I will need to look up the colour definitions in the theme's source code, and then say things like

(face-spec-set 'notmuch-cited-text '((((background light)) (:background "#434C5E"))
			             (((background dark))  (:background "#5E81AC"))))

in my configuration. This is due to the fact, that most themes (nord-emacs being one of this class) simply let-bind a set of clolour symbols, which are then used in an ocean of backtick expressions making up the arguments of a custom-theme-set-faces call. While this is convenient for the theme author(s), it keeps the colour symbols' visibility constrained to the theme's code itself, and thus inaccessible for the user. As a consequence, users will need to have a peek into the engine room to borrow the colours' RGB values, and "adorn" their configuration with (IMHO) unnecessarily wordy, and (due to the use of raw RGB values) hard to read face specifications.

Needless to say that this applies to the vast majority of Emacs themes, and none of it is specific to nord-emacs.

Notwithstanding that fact, I have added to nord-emsacs a prototype implementation of a mechanism, which allows users to put things like this in their configuration:

(use-package nord
  :ensure t
  :custom
  (nord-user-faces
   '((notmuch-search-count (:foreground nord9))
     (notmuch-search-date (:foreground nord-comment))
     (notmuch-tree-match-date-face (:foreground nord4))
     (notmuch-tree-no-match-date-face (:foreground nord-comment))
     (notmuch-search-matching-authors (:foreground nord4))
     (notmuch-tree-match-author-face  (:foreground nord4))
     (notmuch-search-non-matching-authors (:foreground nord-comment))
     (notmuch-tree-no-match-author-face   (:foreground nord-comment))))
  :config
  (load-theme 'nord t))

Before spending the time converting it into a PR, I felt that testing the grounds up front might seem called for. The reason being that, beyond offering more end-user convenience, it would open the door to users overriding the theme's design choices (since I can of course specify for- and background of - for instance - the default face in the nord-user-faces list).

Dear maintainers, what's your take on this? A welcome addition, or having the dog guard the sausages?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions