Colours in nightMode

I’m trying to use nightMode and like it very much – except that it seems to be difficult to tune the colours. In particular, the ‘cloze’ colour (a pure, and therefore very dark, blue on my calibrated screen) is not readable.

I found, in styling, an entry “.nightMode .cloze {…}” but this has no effect and is implausible CSS syntax. Any ideas, anyone?

Thanks – Mike

Why would it be implausible? It means "an element with class cloze and an ancestor with class nightMode", which is what you’d want. If it doesn’t work for you, there could be various reasons. Maybe there is another style with higher precedence? It’s hard to tell without knowing the template.

1 Like

Implausible because I have never seen a blank between two class identifiers in a CSS before; but that doesn’t mean it’s not allowed -).

As for the template … I am using Anki for Windows (and web) with everything as installed at start (i.e., I have not made any changes); recently updated to Version ⁨2.1.49 (dc80804a)⁩.

So … ‘standard template’, I think?

Works for me. How does your styling differ? Have you ruled out add-ons?

1 Like

I’m just using it ‘as installed’ – no addons, no changes. Have you tried that? Maybe you have some addon that makes the difference?

I’m using Version ⁨2.1.49 (dc80804a) … Python 3.8.6 Qt 5.14.2 PyQt 5.14.2 … installed about a week ago.

No, it works without any add-ons.
Maybe there is a misunderstanding here: .nightMode .cloze { color: blue } sets the cloze colour to blue in night mode. It doesn’t ensure readable colours. So if you find the current blue hard to read, you have to replace “blue” with some other colour, e.g. “lightblue”.

Yes, that’s exactly what is set there (lightblue, not blue). I have not made any changes to that. I have not made any changes to any settings. Screenshot attached.

Ah … some progress, following a private message suggestion, I tried rebooting Windows, Now I get light blue in nightMode. It seems that just closing and restarting Anki after setting nightMode is not sufficient (but I hope a reboot isn’t always necessary!).

Any ideas on what is the recommended way to get style settings to ‘take’? Or is it a matter of which deck is active when closing Anki or something like that?

Your original message sounds very much like you already had night mode enabled, and now only wanted to change the cloze colour. If your actual goal was to enable night mode, then the answer is: Yes, you have to restart Anki before changes take effect (unless you use the new beta release). Anki even tells you this after changing this setting.
Changes to your card styling can be viewed live on the other hand, and there is an option to preview the night mode styling as well, no restart required.


Thanks – apologies if I misled. Yes I wanted to use nightMode. This was not usable because the dark blue on grey was not readable {as others also reported in these forums}.

I did find out how to enable night mode (although it is very well hidden!!). Restarting Anki after this did have the nice grey background, etc., but the ‘cloze’ colour remained dark blue (which was unreadable against the dark grey). Only after a reboot did that change to lightblue.

I don’t want to view changes to my card styling ‘live’ (because I am not changing my cards in any way) so I’m not sure what you are suggesting?

Strictly speaking, you are not, you are modifying the notetype. But you do want to change the appearance of the cards, aren’t you? That’s what the window in the above screenshots is for.
And the right half of said window is for live previewing the changes you make to the styling, which will only be made permanent if you click “Save” though.
Rebooting should not be necessary or make a difference for any of this.

1 Like

OK, thanks – I hadn’t discovered the preview option under ‘Options V’. Options and preferences, etc., are all over the place in Anki.

Anyway – all working now; thanks for the hints!