Skip to content

Commit

Permalink
Trello: make styler a little saner
Browse files Browse the repository at this point in the history
  • Loading branch information
kfix committed Dec 5, 2015
1 parent 75b7183 commit a68caae
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions sites/Trello/styler.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,25 @@ var customizeBG = function(el) {
}

var stockTrelloBlue = "rgb(0, 121, 191)";
if ( (document.body.style.backgroundColor == stockTrelloBlue) && overrideStockTrelloBlue && macpinIsTransparent) {
css.innerHTML = 'body { background-color: rgba('+overrideStockTrelloBlue+') !important; } ';
if (macpinIsTransparent) {
css.innerHTML = 'body { background-color: transparent !important; } ';
// could get rgb=getComputedStyle(document.body).backgroundColor.match(/[\d\.]+/g) and convert from original rgb() to rgba()
// http://stackoverflow.com/q/6672374/3878712 http://davidwalsh.name/detect-invert-color
document.body.style.backgroundColor = "transparent";
} else if ( (document.body.style.backgroundColor == stockTrelloBlue) && overrideStockTrelloBlue) {
css.innerHTML = 'body { background-color: rgba('+overrideStockTrelloBlue+') !important; } ';
document.body.style.backgroundColor = 'rgba('+overrideStockTrelloBlue+')';
} else {
document.body.style.backgroundColor = stockTrelloBlue;
css.innerHTML = '{}';
}

if (darkMode) css.innerHTML += "\
body { -webkit-filter:invert(100%); }\
input,img,.window-cover,.list-card-cover,.attachment-thumbnail-preview,.js-open-board,.board-background-select { -webkit-filter:invert(100%); }\
span { color: black; }";
if (darkMode && document.body.style.backgroundColor == "") document.body.style.backgroundColor = "black";

if (darkMode && !macpinIsTransparent && document.body.style.backgroundColor == "") document.body.style.backgroundColor = "black";

document.head.appendChild(css);
};
Expand Down

0 comments on commit a68caae

Please sign in to comment.