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

v1.18.x
psychobunny 11 years ago
parent d734f9f230
commit 70b5f9addc

@ -364,9 +364,19 @@ var fs = require('fs'),
process.exit(); process.exit();
} }
Meta.css.cache = tree.toCSS({ var css = tree.toCSS({
cleancss: true 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.'); winston.info('[meta/css] Done.');
}); });
}); });

Loading…
Cancel
Save