rougier / nano-theme

GNU Emacs / N Λ N O Theme
GNU General Public License v3.0
369 stars 35 forks source link

Feature request: colors for which-key #42

Open Kabouik opened 1 year ago

Kabouik commented 1 year ago

I first came across your emacs work with nano-emacs but now found out about nano-theme too. It be easier to integrate with my pre-existing configuration (fewer conflicting options), so I am considering using it instead of the full nano-emacs suite. On nano-emacs, I was able to add two different color schemes for which-key for both themes (see example below for nano-theme-light.el):

(defun nano-theme-set-light ()
  "Apply light Nano theme base."
  ;; Colors from Material design at https://material.io/
  (setq frame-background-mode    'light)
  (setq nano-color-foreground "#37474F") ;; Blue Grey / L800
  (setq nano-color-background "#FFFFFF") ;; White
  (setq nano-color-highlight  "#FAFAFA") ;; Very Light Grey
  (setq nano-color-critical   "#FF6F00") ;; Amber / L900
  (setq nano-color-salient    "#673AB7") ;; Deep Purple / L500
  (setq nano-color-strong     "#000000") ;; Black
  (setq nano-color-popout     "#FFAB91") ;; Deep Orange / L200
  (setq nano-color-subtle     "#ECEFF1") ;; Blue Grey / L50
  (setq nano-color-faded      "#B0BEC5") ;; Blue Grey / L200
  (setq nano-theme-var "light")          ;; To allow theme switching
  (custom-set-faces
   '(which-key-command-description-face ((t (:foreground "#b0bec5"))))
   '(which-key-group-description-face ((t (:foreground "#673ab7"))))
   '(which-key-key-face ((t (:foreground "#37474f"))))
   '(which-key-local-map-description-face ((t (:foreground "#673ab7"))))
   '(which-key-separator " ")))

However it seems themes do not work the same way in nano-theme and I was not able to replicate my custom changes to add the two color schemes for which-key. Without those changes, which-key shows up with mismatching colors at best, or is not legible at worst. I would be happy to submit a PR but to be honest I couldn't figure out something working so far. If I understand correctly, the two themes in nano-theme include presets for several popular packages with nano-theme-support.el. Would it be possible to add support for which-key?

I believe which-key is a very convenient package for new emacs users who don't know many keybindings yet, and it might be relevant to support it because a good proportion of nano-theme users might also be newcomers who want to quickly escape the ugly default emacs theme, and get some beautiful configuration before knowing how to do all the hard work by themselves.

rougier commented 1 year ago

Integration with nano theme should be easier actually. You can make a PR with your proposed changes (possibly with a screenshot) and I'll merge it. It's mostly a matter of adding the 4 which key faces.