protesilaos / modus-themes

Highly accessible themes for GNU Emacs, conforming with the highest standard for colour contrast between background and foreground values (WCAG AAA).
https://protesilaos.com/emacs/modus-themes
GNU General Public License v3.0
544 stars 30 forks source link

Indistinct background color in swiper candidates #26

Closed wang1zhen closed 2 years ago

wang1zhen commented 2 years ago

image

The current selected candidate is somehow hard to distinguish in the swiper candidates due to the background color of org src blocks, it can be reproduced with following theme configurations:

(use-package modus-themes
      :init
      (setq modus-themes-bold-constructs t
            modus-themes-syntax '(alt-syntax green-strings yellow-comments)
            modus-themes-links '(neutral-underline background)
            modus-themes-hl-line '(intense)
            modus-themes-markup '(intense background)
            modus-themes-paren-match '(intense)
            modus-themes-org-blocks 'gray-background)
      :config
      (modus-themes-load-vivendi))
protesilaos commented 2 years ago

Hello @wang1zhen and thanks for reporting this!

I am trying it now. It has to be a bug with Swiper (or the intersection between Swiper and Org): it prioritises the underlying background. In the following screenshots, I changed the selected line in the minibuffer to a yellow background. But notice how we still get inconsistent results as I move between lines:

2022-03-30_16:19:12_576x576

2022-03-30_16:19:14_576x576

2022-03-30_16:19:16_576x576

wang1zhen commented 2 years ago

I have also tried with vertico and consult, which can reproduce the same issue. AFAIK, vertico-current inherits modus-themes-completion-selected, and the background color of modus-themes-completion-selected seems to get overlapped by the org-block face, and I have no idea about how to fix it.

protesilaos commented 2 years ago

We can try asking Vertico's and Consult's maintainer (@minad). Perhaps adding a priority to the overlay would address this issue where the background of an Org block overrides the currently selected line in the minibuffer?

minad commented 2 years ago

In Vertico the problem should not be as serious since the vertico-current face extends to the full width of the minibuffer. We cannot give vertico-current higher priority, since this would interfere with modus-themes-completions with matches=background. Therefore the vertico-current face is appended to the other faces. I consider this issue as WONTFIX in Vertico/Consult. Either disable fontification in consult-line via consult-fontify-preserve=nil or disable the background for org blocks by modifying modus-themes-org-blocks.

protesilaos commented 2 years ago

Thanks for the explanation!