Google Docs Dark Theme

Make Google Docs a bit darker

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Google Docs Dark Theme
// @namespace    googleDarkTheme
// @version      0.3
// @description  Make Google Docs a bit darker
// @author       JetDave
// @match        https://docs.google.com/document/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    document.body.style.filter = "invert(0.9)";
    window.addEventListener("DOMNodeInserted",invertImgs);
    window.addEventListener("load",invertImgs)
    // kix-embeddedobject-image
    function invertImgs(){
        var elms = document.getElementsByTagName("img");
        for(let elm of elms){
            elm.style.filter = "invert(1)";
        }
        var elms2 = document.getElementsByClassName("kix-spelling-error-overlay");
        for(let elm of elms2){
            elm.style.filter = "invert(1)";
        }
        var elms3 = document.getElementsByClassName("kix-embeddedobject-image");
        for(let elm of elms3){
            elm.style.filter = "invert(1)";
        }
        var elms4 = document.getElementsByClassName("link-bubble-thumbnail-image");
        for(let elm of elms4){
            elm.style.filter = "invert(1)";
        }
    }
})();