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

This commit is contained in:
psychobunny
2014-05-14 17:07:31 -04:00
parent d734f9f230
commit 70b5f9addc

View File

@@ -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.');
});
});