From a68caae4d7a81a64892eb2450b5647de0363341a Mon Sep 17 00:00:00 2001 From: Joey Korkames Date: Sat, 5 Dec 2015 15:22:56 -0800 Subject: [PATCH] Trello: make styler a little saner --- sites/Trello/styler.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/sites/Trello/styler.js b/sites/Trello/styler.js index 71e8671..55d1877 100644 --- a/sites/Trello/styler.js +++ b/sites/Trello/styler.js @@ -26,13 +26,16 @@ 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 = '{}'; } @@ -40,8 +43,8 @@ var customizeBG = function(el) { 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); };