161 4
Sign in to rate

Night Mode

0.02MB. Updated 2018-02-21. Supports both Anki 2.0.x and 2.1.x.


This plugin adds the function of night mode, similar that one implemented in AnkiDroid*. It adds a "view" menu entity with options like: - Automatic (i.e. at specified time) or manual switching of the night mode - Inverting colors of images or latex formulas - Defining custom color substitution rules It provides shortcut ctrl+n to quickly switch mode and a color picker to adjust background and text colors to your liking. After enabling night mode, add-on changes colors of the menubar, toolbar, bottom bars, and contents. When the option "Enable in dialogs" is ticked, it also changes colors of most of the dialog windows (like: 'Add card', 'Browser', 'Statistics', etc.). If "force transparent latex" is enabled, new latex formulas should be generated with transparent background (delete old files to regenerate formulas created before). This add-on is Anki 2.1 compatible (tested with beta 16-31). If you want to contribute visit GitHub repository: krassowski/Anki-Night-Mode. Polite requests Please do not write bug reports on this page. I cannot reply here, and ask you for details which are often crucial to solve your problem :( It's a better idea if you use GitHub (preferred) or e-mail: krassowski.michal@gmail.com If you find this add-on useful, please grade it or write a review :) Also, feel free to send me bug reports or feature requests on GitHub (as well as to fork and star the repository). Changelog If you want to update your copy of this add-on, please remove it and install again from Anki menu. Please note that the 2.x version of the addon (and it's new features) is only available when running Anki 2.1.x == 2.1.6 - February 21, 2018 - Improve visibility of items in table in browser #28 (thanks nathanmalloy!) - Provide potential workaround for Qt bug causing Chinese text to be rendered black when selected == 2.1.5 - January 21, 2017 - Allow to selectively disable parts of the add-on #25, #26 == 2.1.4 - January 20, 2017 - Add night styling to "Statistics" window (styles are applied when "enable in dialogs" option is on) #9. == 2.1.3 - January 15, 2017 - Add compatibility with 2.1 beta 31 (which changed progress dialogs interface). == 2.1.2 - September 23, 2017 - Use night mode colors for synchronization/backup progress pop-up dialogs. - Minor fix: make selected rows in card browser use night mode colors again. == 2.1 - September 22, 2017 - New option: "Automatic mode" (suggested by p2635: #22) - allows to set times at which the nigh mode should be automatically turned on and off. - New option: "Customise colors on cards" - defining custom color mappings just got easier with a new dedicated dialog window - no need to modify source files anymore! == 2.0 - September 19, 2017 - new, rewritten addon, compatibile with Anki 2.1.x Beta 13+. == 1.2.3 - September 6, 2017 - bug fix: make text over difficulty buttons easier to read The full changelog is available on GitHub. Known issues - In browser, the tag tree sidebar was twice observed to disappear when resized in the old (2.0) Anki version on Windows, which may (or may not) be related to changes made by this addon. Use of newer (2.1) Anki version is recommended. - At times some internal formatting breaks when pasting, cutting or entering a new line and causes edited line/text to appear completely white (issue #27). Some workarounds were described for a similiar problem here. It is difficult to fix, but anyone willing to help is encouraged to try and create a pull request later. Known issues from old versions - In some installations on Windows and Mac OS inversion of images doesn't work. This is probably related with some issue of third party library displaying content in Anki - I cannot do anything about it. - Typing Korean and Chinese is problematic - you can find some workarounds on this issue page. If you experience any of the issues above and know a bit about programming, please feel free to join the discussion on GitHub to help fixing these. Night-Mode integrates well with Anki-Zoom for 2.1 - don't forget to check it out! * The add-on is not affiliated with AnkiDroid. Installation of the add-on on your desktop will not affect how your mobile client works.


As add-ons are programs downloaded from the internet, they are potentially malicious. You should only download add-ons you trust.

To download this add-on, please copy and paste the following code into the desktop program:


If you were linked to this page from the internet, please open Anki on your computer, go to the Tools menu and then Add-ons>Browse & Install to paste in the code.

Other Anki 2.0.x Add-Ons Other Anki 2.1.x Add-Ons Ask a Question


on 2018-03-17
Well done!
on 2018-03-14
on 2018-03-14
Nice black
on 2018-03-13
helps my eyes
on 2018-03-09
on 2018-03-03
I love this!
on 2018-03-01
Dark mode is what I love on my monitor.
on 2018-02-22
Thank you, my eyes aren't particularly fond of staring at the bright screen for long periods of time so this is very helpful!
on 2018-02-14
This is awesome!
on 2018-02-04
Very good, but is there any way to change the color of the "Extra Text" in cloze like Ankidroid does it (yellow on black)... Dark blue on black is unreadable, was able to change cloze text in code but can't find extra.
on 2018-01-28
Good extension, very useful!
on 2018-01-27
on 2018-01-22
Great Addon!

Only major bug I've been experiencing is that Anki Crashes when Syncing!
I have the zanki deck loaded (1gb), so this may play a part in it. If anyone/the dev know of a solution, please let me know!
on 2018-01-18
on 2018-01-18
Does what is advertised and more. The color swapping is very useful for quick changes. I realise this is called Night Mode and all but with it's versatility could you implement themes/presets so a person can switch from dark to sepia etc on the fly.
Also thanks to the kind reviewer down below suggesting f.lux.
on 2018-01-16
Pair this up with https://ankiweb.net/shared/info/1333758373 and properly thank your eyes for all the hard work they do when you're at the computer.
on 2018-01-15
not working on beta 31 (anki 2.1) :(
still giving it a thumbs up
on 2018-01-10
Excellent! Just what my eyes needed.
on 2018-01-09
on 2018-01-04
on 2017-12-30
This happened after using AnkiMobile iOS version. May be related or just a coincidence!

Switching night mode failed: Something went really really wrong.
Contact add-on author to get help.

Please provide following traceback when reporting the issue:
Traceback (most recent call last):
File "/Users/Library/Application Support/Anki2/addons/Night_Mode.py", line 598, in nm_on
File "/Users/Library/Application Support/Anki2/addons/Night_Mode.py", line 567, in nm_append_to_styles
File "aqt/deckbrowser.pyc", line 30, in refresh
File "aqt/deckbrowser.pyc", line 142, in _renderPage
File "anki/sched.pyc", line 261, in deckDueTree
File "anki/sched.pyc", line 246, in deckDueList
File "anki/sched.pyc", line 426, in _newForDeck
File "anki/db.pyc", line 76, in scalar
File "anki/db.pyc", line 43, in execute
InterfaceError: Error binding parameter 0 - probably unsupported type.
on 2017-12-20
Font colours keep getting messed up when editing existing notes.

For example, as I learn new kanji, I modify existing flash cards during my review to include the new kanji I have learned. When I do this I like to hit CTRL+Home and then press enter a few times to create space in the expression field of a flashcard for me to type words with updated kanji. I then paste these words into the original sentence, and reading. I then delete the extra unneeded characters. I have better luck doing this as I'm pretty picky with my furigana readings on my cards. If I do this with this add-on installed and enabled, the font colours get screwed up on my cards. When text should be white in night mode, it starts to show up as black, and when it should be black in night mode it shows up at white.

I un-installed because of this.
on 2017-12-19

If you have severe problems with staring at a bright computer screen, consider:
(a) increasing your intake of vitamin A (if your eyes hurt when you look at a computer screen, that is a telltale sign of vitamin A deficiency)
(b) installing the free software called Flux (download: https://justgetflux.com/) on your computer. The purpose of this software is exactly to make your eyes not hurt when you look at the computer screen. It does so by lowering the blue-spectre color of the screen (which is what causes the sensation of eye burning). Install Flux, then set it to lower the blue-spectre color of your computer screen: you will notice that the "eye burning" sensation magically goes away and you can use the computer normally.

The add-on is good and all, but I want to point those things out. :)
on 2017-12-12
Its works!
on 2017-12-06
The eyes refuse to work without this addon. Well done!
on 2017-12-03
Great looking dark theme
on 2017-11-30
Thank you immensely!

I really love this feature in AnkiDroid and now can happily enjoy using it in desktop version.
on 2017-11-27
love it !
on 2017-11-27
Gut fuer nacht lernen.
on 2017-11-23
Much needed.
on 2017-11-23
on 2017-11-21
on 2017-11-16
It looks so much better! Would like more of these skins to make Anki feel less old school.
on 2017-11-15
on 2017-11-15
very useful
on 2017-08-17
How to fix issues with multiple plugins

As someone else has mentioned in the reviews, other plugins do not always work well with this plugin.
The workaround for this is to edit the plugins. See menu bar: Tools>add ons>your addon>edit

Example #1: for a font plugin set font color 000000 (black) to ffffff (white)
(this worked with the plugin KanjiInfo)
Example #2: for a replay button plugin, set button color black to white
(this worked with the plugin Replay buttons on card)
on 2017-08-11
Nice add-on!

Converts the most frequently used parts of Anki to a nice dark theme.
I've had no issues when using it (stand-alone)
Thank you for maintaining this add-on!
on 2017-07-14
This is awesome!

Unfortunately it has minor issues with other plugins but it's completely fine.
on 2017-05-09

That's really beautiful. I love it.
on 2017-04-29
Thank you!

It's very useful , thank you author.
on 2017-04-07
Beautiful, but...

I am using the version from March 2017. I have experienced only two issues, so far:
1. If the file browser window is not maximized completely, the user is not allowed to resize and widen the left panel. When maximized, he is allowed to resize it, but still not as much as before installing your addon.
2. The first few drop-down menus on the left side of the screen look great, but the last few menus retain their original color scheme.
Some of this may be the fault of other addons conflicting with yours, but I noticed these things only after installing your addon, so I assume that it is because of your addon.
Thanks for your hard work: the rest is working well, and makes everything easier to read.
on 2017-03-01
Great except one problem

I've also found another bug. After creating new cards when using this add-on, when you're NOT using this add-on to study those cards, those cards are sometimes problematic: text with white color. You might think that's an empty card but try highlighting those empty space, you'll see the text.

When I am typing Korean while reviewing, the Hangul disappears after deleting a word. To illustrate this problem more clearly, I will use English as as example:
Type: " I am learning Korean.", after deleting the word "Korean", the whole sentence is gone unless I click away from the texting box and click back again.
This problem happens in other languages except English. Please fix this. Thank you very much:)
on 2017-02-16

That's what I was looking for!

Thanks man!
on 2017-01-28
The button's on the bottom are skewed

Gave this 3 stars pending a fix on the buttons that become large and skewed when night mode is activated during study. The "again, hard, good and easy" buttons are not visible at all. Also, the review card amount tracker is not enabled.
on 2017-01-15
on 2016-12-21

Works fine.
on 2016-10-24
Amazing! So glad I found this add-on!

Does exactly what I've been trying to do for the past few weeks.

It lets me choose the background color, the text color, and I was able to go into the code and change the cloze color easily.

Thank you so much for this!
on 2016-08-29
Pretty good

YSK that you can use it to have different CSS in day mode and night mode. tag <body> has a class "night_mode", so you can use something like this to style other classes.

.q {color: #494a7f;} /* normal mode */
.night_mode .q {color: #a9aaef;} /* night mode */

Copying text from dialogues sometimes copies the the text colored, so that's a bit of a drawback
on 2016-05-30
Anki graphs

please add Night Mode for Anki graphs like this style. thank you.

on 2016-05-20
Must have this one.

Takes care of your eyes.
on 2016-04-22
Looks awesome!

Smooth functionality and looks sweet. No more nighttime eye strain.
on 2016-03-07

This theme is fantastic. Thank you.

Minor issue: the scrollbar in the Browser is still black.
on 2016-03-01
Almost perfect!

Almost perfect. That's exactly what I was looking for. There is a minor imperfection, though: the review buttons don't get highlighted when they have the focus, so you can't tell which button is currently selected,

Apart from that, great great addon! Don't forget to check the Enable In Dialogs menu check boxs as well!
on 2016-01-30
Excellent, almost perfect

This add-on has made my evening reviews much easier on the eyes and also more fun :) I noticed that there are still UI text elements that are black, such as the "+-" expand/contract to the left of each deck with subdecks. This being fixed, it would be perfect.

EDIT (1/29/2016): Thank you for the fix! It's perfect now!
on 2016-01-16
so great for protecting your eyes..........

I like this addon so much.......it really helps to protect my eyes.......thank you for your addon......it's very useful..........
on 2015-12-28
Amazing unless you use hyperlinks[Fixed]

Amazing now....
on 2015-12-23
could be great...

all of my cards contain LaTeX equations and it kind of defeats the purpose to go into Night Mode since it doesn't invert the color of the PDFs ... just get a bright white block with equation on a black background...
on 2015-11-30

I've been waiting for this kind of addon for so long. Thank you so much!
on 2015-11-24

This is one of my favorite add-ons :D
on 2015-10-15

Does what the title says.
Very Nice! Missed this function before.
on 2015-07-30
invert image

Firstly, I would like to say "thank you" for developer of this add-on!
But I can invert image with this add-on actually!
Hope you can fix as soon as possible!
Thanks again!^^
on 2015-07-26
Very useful

I use it even at daytime because I hate bright light.
Some minor problem/s:
Usually buggy, especially when syncing Anki would sometimes crash (or maybe that's just me because I have a really large collection).
Doesn't work on some dialogs (browser, options, etc)
on 2015-06-22
Bug report.

on 2015-06-02
Great for studying in the dark

I agree with my foretalkers: Great addon!

I also agree on the major drawback: Brower and Add-Dialog should be styled black too.

Another drawback is the missing ".night"-CSS-Styles, that are supported in AnkiMobile.

One Solution is to overwrite Anki's function for generating the card's html with one that also interprets the nm_state_on variable:

from anki.utils import isMac, isWin
from anki import js
import anki
from aqt import webview

def stdHtml(self, body, css="", bodyClass="", loadCB=None, js=None, head=""):
# this is new:
if nm_state_on:
bodyClass = bodyClass + " night"

if isMac:
button = "font-weight: bold; height: 24px;"
button = "font-weight: normal;"
<!doctype html>
button {

<body class="%s">%s</body></html>""" % (
button, css, js or anki.js.jquery+anki.js.browserSel,
head, bodyClass, body), loadCB)

webview.AnkiWebView.stdHtml = stdHtml
on 2015-05-06
Great plugin

Great plugin. thanks for taking the time to write this.