syl20bnr / spacemacs

A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *and* Vim!
http://spacemacs.org
GNU General Public License v3.0
23.64k stars 4.89k forks source link

Low color contrast in spaceline-highlight face while running in terminal. #10916

Closed jsoo1 closed 4 years ago

jsoo1 commented 6 years ago

Description :octocat:

Low color contrast in spaceline highlight face when running in terminal.

Reproduction guide :beetle:

Observed behaviour: :eyes: :broken_heart: Very low color contrast in spaceline (the highlight face, particularly), like observed in https://github.com/TheBB/spaceline/issues/109 and https://github.com/TheBB/spaceline/issues/37. I originally commented in those issues but I think my issue is related to the way spacemacs configures spaceline.

Expected behaviour: :heart: :smile: Dark foreground colors in the spaceline highlight face for nice visibility.

Extra information :books:

Adding lines like the following in .spacemacs fixes the issue. So it seems like the spacemacs faces are getting overridden somewhere.

(set-face-attribute 'spacemacs-normal-face nil :foreground "#262626")
(set-face-attribute 'spacemacs-hybrid-face nil :foreground "#262626")
(set-face-attribute 'spacemacs-emacs-face nil :foreground "#262626")
(set-face-attribute 'spacemacs-evilified-face nil :foreground "#262626")
(set-face-attribute 'spacemacs-visual-face nil :foreground "#262626")
(set-face-attribute 'spacemacs-replace-face nil :foreground "#262626")
;; etc

System Info :computer:

jsoo1 commented 6 years ago

I am looking into this some more and I had a question about the various spacemacs-%s-face in spacemacs//evil-state-face. Is that indeed where the spaceline highlight faces are defined for spacemacs?

jsoo1 commented 6 years ago

Looking at spacemacs/define-evil-state-face:

 (eval `(defface ,(intern (format "spacemacs-%s-face" state))
           `((t (:background ,color
                             :foreground ,(face-background 'mode-line)
                             :inherit 'mode-line)))
           (format "%s state face." state)
           :group 'spacemacs)))

Creates the faces, but according to https://www.gnu.org/software/emacs/manual/html_node/emacs/Standard-Faces.html, mode-line is

... The inverse of the default face on non-windowed terminals

The default face background color is unspecified-bg in terminal (at least how I see it now). I believe this is the problem. Would the solution be to make the foreground something specific if (daemonp) is non-nil?

jsoo1 commented 6 years ago

I don't know if this is the best solution since I'm still not 100% clear why the mode-line background is nil in daemon, but this does solve my issue. I do know that when spacemacs/define-evil-state-face is called, (face-background 'mode-line) is nil when in daemon.

jsoo1 commented 6 years ago

This seems related to https://github.com/syl20bnr/spacemacs/issues/6197. Not sure the best way to proceed.

github-actions[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!