The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
import { type CollectedTokenLeaf } from '../types/CollectedTokenLeaf';
import { quoteSingle } from './quoteSingle';
export const renderStaticTokenValue = ({
leaf,
scheme,
}: {
leaf: CollectedTokenLeaf;
scheme: 'light' | 'dark';
}): string => {
if (leaf.jsValue === 'cssVariable') {
return quoteSingle(`var(${leaf.varName})`);
}
const value = scheme === 'light' ? leaf.light : leaf.dark;
return leaf.unit === 'number' ? String(Number(value)) : quoteSingle(value);
};