Jwrede / Anki-KaTeX-Markdown

Creates a new Basic and a new Cloze Note Type that support Markdown and KaTeX
74 stars 5 forks source link

Different syntax highlighting theme for nightmode. #36

Closed NiamhFerns closed 1 year ago

NiamhFerns commented 1 year ago

It's pretty easy to change the background colour so that the syntax highlighting is visible in dark mode, but it's still clear that the actual highlighting being used on the text itself is intended for a light mode background (dark greens, reds, etc).

It's not a major thing, but is it possible to change this?

I've tried replacing the _highlight.css file with one of a different theme from the https://highlightjs.org/download/ website. This doesn't change anything however.

renercrisostomo commented 1 year ago

Add

.nightMode pre code {
    color: black;
    filter: invert(1) hue-rotate(180deg);
}
.mobile .night_mode pre code {
    color: white;
    filter: invert(0) hue-rotate(0deg);
}

on line 604 in HTMLandCSS.py

image

Desktop and AnkiDroid: image

NiamhFerns commented 1 year ago

That does it. Thank you c:.