fix(eidos): QrCode size tokens use literal var names (recipe contract)

Size was applied via `var(--qr-code-size-${resolvedSize})` (interpolated), so
the literal token names never appeared in source and the recipe-css-contract
test flagged --qr-code-size-{xs..xl} as orphaned. Use an explicit literal map so
each name appears verbatim; behaviour unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
active-uix
dev 4 months ago
parent e5303f8217
commit 34f8087fe8

@ -28,8 +28,17 @@
const eidos = ActiveEidos.require();
const resolvedSize = $derived(eidos.resolve(size, 'md'));
// Literal map (not interpolated) so each --qr-code-size-* token name appears
// verbatim in the source — the recipe contract scans for exact token names.
const SIZE_VARS = {
xs: 'var(--qr-code-size-xs)',
sm: 'var(--qr-code-size-sm)',
md: 'var(--qr-code-size-md)',
lg: 'var(--qr-code-size-lg)',
xl: 'var(--qr-code-size-xl)'
} as const;
const px = $derived(
typeof resolvedSize === 'number' ? `${resolvedSize}px` : `var(--qr-code-size-${resolvedSize})`
typeof resolvedSize === 'number' ? `${resolvedSize}px` : SIZE_VARS[resolvedSize]
);
// A logo needs max redundancy + a cleared centre to stay scannable.

Loading…
Cancel
Save

Powered by TurnKey Linux.