Merge pull request #528 from matrix-org/rav/fix_tinting

Fix room tinting
pull/21833/head
David Baker 2016-10-27 09:57:00 +01:00 committed by GitHub
commit 974e4c05c8
1 changed files with 15 additions and 2 deletions

View File

@ -90,7 +90,20 @@ function calcCssFixups() {
// See also #vector:matrix.org/$145357669685386ebCfr:matrix.org
// ...except some browsers apparently return stylesheets without
// hrefs, which we have no choice but ignore right now
if (ss.href && !ss.href.endsWith("/bundle.css")) continue;
// XXX seriously? we are hardcoding the name of vector's CSS file in
// here?
//
// Why do we need to limit it to vector's CSS file anyway - if there
// are other CSS files affecting the doc don't we want to apply the
// same transformations to them?
//
// Iterating through the CSS looking for matches to hack on feels
// pretty horrible anyway. And what if the application skin doesn't use
// Vector Green as its primary color?
if (ss.href && !ss.href.match(/\/bundle.*\.css$/)) continue;
if (!ss.cssRules) continue;
for (var j = 0; j < ss.cssRules.length; j++) {
var rule = ss.cssRules[j];