Skip to content

Commit

Permalink
fix(meta-css): update template arity calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Mar 17, 2024
1 parent 9509cc3 commit ac50c39
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/meta-css/src/generate.ts
Expand Up @@ -197,8 +197,10 @@ export const expandSpec = (
const values = __items(spec, config);
const ownNames = new Set<string>();
for (let currVarID of variationIDs) {
const variations = config.vars?.[currVarID] || VARIATIONS[currVarID];
if (!variations) illegalArgs(`unknown variation ID: ${currVarID}`);
for (let [varValue, currKey] of permutations(
config.vars?.[currVarID] || VARIATIONS[currVarID],
variations,
Object.keys(values)
)) {
const name = __withVariations(
Expand Down Expand Up @@ -238,14 +240,14 @@ export const expandSpec = (
illegalArgs(`duplicate class ID: ${name}`);
}
ownNames.add(name);
let maxArity = 0;
let maxArity = -1;
for (let [k, v] of Object.entries(props)) {
const prop = __withVariations(
k,
currVarID,
varValue,
currKey,
values[currKey]
values[currKey] // value without unit
);
const val = __withVariations(
!unit || isString(v) ? String(v) : UNITS[unit](v),
Expand Down

0 comments on commit ac50c39

Please sign in to comment.