@indielayer/ui
Version:
Indielayer UI Components with Tailwind CSS build for Vue 3
27 lines (26 loc) • 637 B
JavaScript
const u = ["dark"], a = ["hover", "active", "focus", "visited"], f = (n) => u.includes(n), v = (n) => a.includes(n), d = (n) => {
const $ = (i, e, t, s) => `${r(i, t, s)}: ${e}`, r = (i, e, t) => `--x${n ? `-${n}` : ""}${e ? `-${e}` : ""}-${i}${t ? `-${t}` : ""}`, l = (i, e, t) => {
let s = {};
for (const o in i) {
const c = i[o];
if (!c)
break;
f(o) ? s = {
...s,
...l(c, o, t)
} : v(o) ? s = {
...s,
...l(c, e, o)
} : s[r(o, e, t)] = c;
}
return s;
};
return {
get: $,
variable: r,
variables: l
};
};
export {
d as useCSS
};