diff --git a/Core/Notification/TweetNotification.cs b/Core/Notification/TweetNotification.cs index a0b0c612..2e018602 100644 --- a/Core/Notification/TweetNotification.cs +++ b/Core/Notification/TweetNotification.cs @@ -9,7 +9,7 @@ sealed class TweetNotification{ private const string DefaultFontSizeClass = "medium"; private const string DefaultHeadTag = @"<meta charset='utf-8'><meta http-equiv='X-UA-Compatible' content='chrome=1'><link rel='stylesheet' href='https://ton.twimg.com/tweetdeck-web/web/css/font.5ef884f9f9.css'><link rel='stylesheet' href='https://ton.twimg.com/tweetdeck-web/web/css/app-dark.5631e0dd42.css'>"; - private const string CustomCSS = @".scroll-styled-v::-webkit-scrollbar{width:8px}.scroll-styled-v::-webkit-scrollbar-thumb{border-radius:0}#td-skip{opacity:0;cursor:pointer;transition:opacity 0.15s ease}.td-hover #td-skip{opacity:0.75}#td-skip:hover{opacity:1}"; + private const string CustomCSS = @"body:before{content:none}body{overflow-y:auto}.scroll-styled-v::-webkit-scrollbar{width:7px}.scroll-styled-v::-webkit-scrollbar-thumb{border-radius:0}.scroll-styled-v::-webkit-scrollbar-track{border-left:0}#td-skip{opacity:0;cursor:pointer;transition:opacity 0.15s ease}.td-hover #td-skip{opacity:0.75}#td-skip:hover{opacity:1}"; public static int FontSizeLevel{ get{ @@ -90,15 +90,15 @@ public string GenerateHtml(string bodyClasses = null, bool enableCustomCSS = tru } build.Append("</head>"); - build.Append("<body class='hearty"); + build.Append("<body class='hearty scroll-styled-v"); if (!string.IsNullOrEmpty(bodyClasses)){ build.Append(' ').Append(bodyClasses); } - build.Append('\'').Append(isExample ? " td-example-notification" : "").Append("><div class='app-columns-container'><div class='column scroll-styled-v' style='width:100%;overflow-y:auto;border-top:0;padding-top:1px'>"); + build.Append('\'').Append(isExample ? " td-example-notification" : "").Append("><div class='column' style='width:100%;height:auto;overflow:initial;'>"); build.Append(html); - build.Append("</div></div></body>"); + build.Append("</div></body>"); build.Append("</html>"); return build.ToString(); } diff --git a/Resources/Scripts/code.js b/Resources/Scripts/code.js index ef4b9fa2..367efbd5 100644 --- a/Resources/Scripts/code.js +++ b/Resources/Scripts/code.js @@ -39,6 +39,21 @@ }; }; + // + // Function: Retrieves a property of an element with a specified class. + // + var getClassStyleProperty = function(cls, property){ + let column = document.createElement("div"); + column.classList.add(cls); + column.style.display = "none"; + + document.body.appendChild(column); + let value = window.getComputedStyle(column).getPropertyValue(property); + document.body.removeChild(column); + + return value; + }; + // // Function: Event callback for a new tweet. // @@ -79,6 +94,7 @@ }); tags.push("<style type='text/css'>"); + tags.push("body { background-color: "+getClassStyleProperty("column", "background-color")+" }"); tags.push("a[data-full-url]{ word-break: break-all }"); tags.push(".txt-base-smallest .badge-verified:before { height: 13px !important }"); tags.push("</style>");