@koda-sl/baker-cli 0.192.2 → 0.192.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +10 -4
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -32243,6 +32243,9 @@ function isCreamColor(c) {
|
|
|
32243
32243
|
|
|
32244
32244
|
// src/engine/landing/lib/brand-tokens.ts
|
|
32245
32245
|
var EMPTY = { fonts: /* @__PURE__ */ new Set(), colors: [], hasTokens: false };
|
|
32246
|
+
function isWeightOrStyle(value) {
|
|
32247
|
+
return /^(?:\d+(?:\.\d+)?[a-z%]*|normal|bold|bolder|lighter|italic|oblique|none|auto)$/i.test(value);
|
|
32248
|
+
}
|
|
32246
32249
|
function parseBrandTokens(globalCss, brandMd) {
|
|
32247
32250
|
const fonts = /* @__PURE__ */ new Set();
|
|
32248
32251
|
const colors = [];
|
|
@@ -32251,10 +32254,13 @@ function parseBrandTokens(globalCss, brandMd) {
|
|
|
32251
32254
|
return { fonts, colors, hasTokens: fonts.size > 0 || colors.length > 0 };
|
|
32252
32255
|
}
|
|
32253
32256
|
function parseGlobalCss(rawCss, fonts, colors) {
|
|
32254
|
-
const globalCss = rawCss.replace(/\/\*[\s\S]*?\*\//g, " ");
|
|
32255
|
-
for (const m of globalCss.matchAll(
|
|
32256
|
-
const
|
|
32257
|
-
if (
|
|
32257
|
+
const globalCss = rawCss.replace(/\/\*[\s\S]*?\*\//g, (block) => block.replace(/[^\n]/g, " "));
|
|
32258
|
+
for (const m of globalCss.matchAll(/(?<![\w-])--font-([\w-]*)\s*:\s*([^;]+);/gi)) {
|
|
32259
|
+
const slug = m[1] ?? "";
|
|
32260
|
+
if (slug.includes("--") || /^weight(?:$|[-\s])/i.test(slug)) continue;
|
|
32261
|
+
const first = (m[2] ?? "").split(",")[0]?.trim().replace(/^['"]|['"]$/g, "").toLowerCase();
|
|
32262
|
+
if (!first || isWeightOrStyle(first)) continue;
|
|
32263
|
+
fonts.add(first);
|
|
32258
32264
|
}
|
|
32259
32265
|
for (const m of globalCss.matchAll(
|
|
32260
32266
|
/--color-[\w-]*\s*:\s*(#[0-9a-f]{3,8}\b|rgba?\([^)]+\)|oklch\([^)]+\)|hsla?\([^)]+\))/gi
|