UNPKG

@aplus-frontend/ui

Version:

16 lines (15 loc) 470 B
const a = ["lineClamp"]; function d(e, i) { const r = [...a, ...i?.skipUnit || []], c = Math.random().toString(36).slice(2); return Object.entries(e).reduce((n, [u, t]) => { const s = typeof t == "number" && !r.includes(u) ? `${t}px` : t; return n[o(u)] = s, i?.uniqueId && (n["--unique-id"] = c), n; }, {}); } function o(e) { return "--" + e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(); } export { o as camelToKebab, d as generateCssVar };