MCPcopy Create free account
hub / github.com/amaancoderx/npxskillui / parseSizeToPixels

Function parseSizeToPixels

src/normalizer.ts:546–552  ·  view source on GitHub ↗
(size: string)

Source from the content-addressed store, hash-verified

544}
545
546function parseSizeToPixels(size: string): number {
547 const px = size.match(/([\d.]+)\s*px/);
548 if (px) return parseFloat(px[1]);
549 const rem = size.match(/([\d.]+)\s*rem/);
550 if (rem) return parseFloat(rem[1]) * 16;
551 return 0;
552}
553
554// ── Spacing ───────────────────────────────────────────────────────────
555

Callers 1

normalizeTypographyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected