Anki-Night-Mode icon indicating copy to clipboard operation
Anki-Night-Mode copied to clipboard

Highlights do not invert

Open JakedGr8 opened this issue 5 years ago • 4 comments

Problem description

When something is highlighted in Anki, and I turn on night mode, the highlighted content does not invert. I use a "yellow" higlight, which in night mode makes the white text difficult to read.

(Edit: just want to add thank you ahead of time for your help. I looked around, and couldn't find this mentioned anywhere! Sorry if it's found somewhere else)

Checklist

Please put x inside brackets if following sentences apply to you:

  • [X ] I verified that I use the lastest add-on version,
  • [X ] I verified that I use the lastest Anki version,
  • [ X] I tried to disable other add-ons to find the culprit,
  • [X ] I checked if anyone reported this problem before, as well as Known issues section on add-ons page,
  • [ ] My issue is solved when holding shift while starting Anki.

Information about your Anki Setup

Please open Anki, go to Help → About, look-up two lines, starting with Version: and Qt and copy-paste them below:

Version 2.1.10 (22d6feed)
Qt 5.12.1 PyQt 5.11.3

Please got to Night Mode → About now and copy-paste the first line from the pop-up window below:

Night Mode x.x.x (no idea - but I hit update so it should be the latest version)

Please fill in your OS details (Linux/Mac/Windows):

OS: MacOS Sierra 10.12.6 (16G1815)

If you have a compatibility problem with a specific add-on or add-ons, please paste the add-on page links below:

Screen Shot 2019-03-23 at 11 40 02 AM

Backtrace (if any)

If you had an error which resulted in producing exception with a backtrace, please paste the backtrace below:

[paste your backtrace in here if you got any; otherwise feel free to remove this part]

JakedGr8 avatar Mar 23 '19 15:03 JakedGr8

How do you add the highlight? I do not see an option for that among the available buttons:

Screenshot from 2019-03-23 15-49-27

May I ask you to post the html code of your card (click on the hamburger icon in the edit window, usually the last icon - on my screenshont the penultimate one; select edit html, copy-paste here)?

krassowski avatar Mar 23 '19 15:03 krassowski

Wow I actually forgot that was an addon, not a default feature of anki - I'm using the Mini Format Pack (https://ankiweb.net/shared/info/295889520). Html code below:

<div><b>{{c2::Anorexia Nervosa}}</b>&nbsp;is defined as <u>excessive dieting</u>, <u>exercise</u>, or <u>binge eating / purging</u> with&nbsp;<span style="background-color: rgb(240, 244, 198);"><b style="">BMI {{c1::&lt; 18.5}} kg/m</b><sup style="font-weight: bold;">2</sup></span></div><div><br></div>

JakedGr8 avatar Mar 23 '19 16:03 JakedGr8

Use this snippet to overwrite highlight styling in night mode (look at the span style that you provided - I use it to target the highlight using exact match of attributes):

.night_mode span[style="background-color: rgb(240, 244, 198);"] {
    background-color:red!important
}

Have a look a the gif if you do not know where to paste it: its-working

And don't worry if you Anki looks slightly different, I was recording with a work-in-progress version of the add-on and Anki (and on Linux). Edit: And as I've just noticed I did not set the card-type to cloze, but it should not matter in this case at all.

krassowski avatar Mar 24 '19 13:03 krassowski

That worked! Thank you so much for your help, I really appreciate it!

JakedGr8 avatar Mar 24 '19 17:03 JakedGr8