Skip to content

Commit

Permalink
feat(meta-css): add support for file-local variation defs
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Dec 23, 2023
1 parent a30bdb0 commit 3a8e1a3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/meta-css/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export interface GeneratorConfig {
info?: SpecInfo;
media?: IObjectOf<string>;
tables?: IObjectOf<IObjectOf<NumOrString> | string[] | number[]>;
vars?: IObjectOf<string[]>;
specs: Spec[];
}

Expand Down
4 changes: 2 additions & 2 deletions packages/meta-css/src/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export const GENERATE: Command<

/** @internal */
export const expandSpec = (
config: Pick<GeneratorConfig, "tables">,
config: Pick<GeneratorConfig, "tables" | "vars">,
spec: Spec,
defs: IObjectOf<any>,
logger: ILogger
Expand All @@ -132,7 +132,7 @@ export const expandSpec = (
const ownNames = new Set<string>();
for (let currVarID of variationIDs) {
for (let [varValue, currKey] of permutations(
VARIATIONS[currVarID],
config.vars?.[currVarID] || VARIATIONS[currVarID],
Object.keys(values)
)) {
const name = __withVariations(
Expand Down

0 comments on commit 3a8e1a3

Please sign in to comment.