Skip to content

Node.js based forum software built for the modern web

some regex to scour the CSS and figure out the branding colors

psychobunny70b5f9addcd6
diff --git a/src/meta.js b/src/meta.js
index a73de67c8d..43d768fa37 100644
--- a/src/meta.js
+++ b/src/meta.js
@@ -364,9 +364,19 @@ var fs = require('fs'),
process.exit();
}
- Meta.css.cache = tree.toCSS({
+ var css = tree.toCSS({
cleancss: true
});
+
+ var re = /.brand-([\S]*?)[ ]*?{[\s\S]*?color:([\S\s]*?)}/gi,
+ match,
+ branding = {};
+
+ while (match = re.exec(css)) {
+ branding[match[1]] = match[2];
+ }
+
+ Meta.css.cache = css;
winston.info('[meta/css] Done.');
});
});