User Tools

Site Tools


dark_input

Using a dark background theme you cannot read input fields and textareas because the lazy web developers specified a color or a background-color but not both? Here, fix it with this.

(function() {
    window.addEventListener('load', function() {
        css = 'input {color: white !important; background-color: black !important;} textarea {color: white !important; background-color: black !important;}';
        var heads = document.getElementsByTagName("head");
        if (heads.length > 0) {
            var node = document.createElement("style");
            node.type = "text/css";
            node.appendChild(document.createTextNode(css));
            heads[0].appendChild(node);
        }
    }, false);
})();

Add “script $XDG_CONFIG_HOME/uzbl/scripts/dark_input.js” (or whatever) to e.g. your load_commit_handler.

dark_input.txt · Last modified: 2016/08/31 14:10 (external edit)