← All examples

JavaScript Look & feel wikipedia.org

Wikipedia: dark mode

Applies a tuned dark theme to Wikipedia for background, text, tables and code blocks.

Code to copy

(function () {
    var ID = 'jz-wiki-dark';
    if (document.getElementById(ID)) return;
    var st = document.createElement('style');
    st.id = ID;
    st.textContent =
        'body,#content,.mw-body,.mw-page-container{background:#1e1e24!important;color:#d4d4da!important}' +
        'a{color:#7aa2f7!important}a:visited{color:#b083f0!important}' +
        '.mw-parser-output table,.infobox,.navbox{background:#26262e!important;border-color:#3a3a44!important}' +
        'h1,h2,h3,h4,#firstHeading{color:#e8e8ee!important;border-color:#3a3a44!important}' +
        'pre,code{background:#2c2c34!important;color:#d4d4da!important}';
    (document.head || document.documentElement).appendChild(st);
})();

How to use this example

  1. Copy the code with the button above.
  2. Install JustZix (2 minutes) and open the extension on the target page.
  3. Add a new rule matching that page.
  4. Paste the code into the rule's JavaScript panel and save — it runs on every page visit.

Rate this example

No ratings yet — be the first.

Does this example work?

Snippets are useless without somewhere to paste them.

JustZix takes 2 minutes to install and runs your code on every matching page. No account, no payment.

Download free See use cases