mirror of
https://github.com/danbulant/dribbblish-dynamic-theme
synced 2026-05-26 13:31:45 +00:00
13 lines
379 B
JavaScript
13 lines
379 B
JavaScript
const REGEX = /(?<key>.*?):.*?#(?<color>.*?)/gm;
|
|
|
|
module.exports = function (content, map, meta) {
|
|
const matches = [...content.matchAll(REGEX)];
|
|
const outLines = ["[base]"];
|
|
|
|
for (let i = 0; i < matches.length; i++) {
|
|
const { key, color } = matches[i].groups;
|
|
outLines.push(`${key} = ${color}`);
|
|
}
|
|
|
|
return outLines.join("\n");
|
|
};
|