(fix) use first value in case variables.scss define multiple values per variable

defect: /api/banner crashes as no variable was found for the font
This commit is contained in:
Valentyne Stigloher 2024-02-17 19:28:13 +01:00
parent 4357ba235a
commit 3cdf7b6814

View File

@ -6,7 +6,7 @@ const __dirname = new URL('.', import.meta.url).pathname;
const vars = {};
for (const [, name, value] of fs.readFileSync(`${__dirname}/../data/variables.scss`).toString('utf-8')
.matchAll(/^\$([^:]+): '([^']+)';$/gm)) {
.matchAll(/^\$([^:]+): '([^']+)'(?:, '[^']+')*;$/gm)) {
vars[name] = value;
}