Greasy Fork

Twitter black background

Changes twitter's new image-less background to a more palatable color

当前为 2015-08-07 提交的版本,查看 最新版本

// ==UserScript==
// @name         Twitter black background
// @namespace    http://www.kennyzaron.com
// @description  Changes twitter's new image-less background to a more palatable color
// @include      https://twitter.com/*
// @grant        none
// @version      1.2.08072015
// ==/UserScript==

function addGlobalStyle(css) {
    var head, style;
    head = document.getElementsByTagName('head')[0];
    if (!head) { return; }
    style = document.createElement('style');
    style.type = 'text/css';
    style.innerHTML = css;
    head.appendChild(style);
}

addGlobalStyle('html { background-color: #363636; }');
addGlobalStyle('.ProfileHeaderCard-locationText, .ProfileHeaderCard-screenname, \
                .ProfileHeaderCard, \
                .ProfileHeaderCard-joinDateText, .PhotoRail-headingWithCount { color: #EFEFEF; }');
addGlobalStyle('.TwitterCardsGrid { background-color: #FFF !important; }');

document.getElementById('page-outer').setAttribute("style", "background-color: #363636;");