mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-21 03:42:00 +01:00
some regex to scour the CSS and figure out the branding colors
This commit is contained in:
12
src/meta.js
12
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.');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user