krassowski / Anki-Night-Mode

Enabling studying at night with Anki - without eye strain
https://ankiweb.net/shared/info/1496166067
GNU General Public License v3.0
72 stars 13 forks source link

Highlights do not invert #66

Open JakedGr8 opened 5 years ago

JakedGr8 commented 5 years ago

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:

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:* - [Other add-on name](https://)

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:* ```python" [paste your backtrace in here if you got any; otherwise feel free to remove this part] ```
krassowski commented 5 years ago

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)?

JakedGr8 commented 5 years ago

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>

krassowski commented 5 years ago

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.

JakedGr8 commented 5 years ago

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