Skip to content

Commit 9478d0d

Browse files
committed
refactor: returns tokens and new renamed styles function
1 parent 5f8ef10 commit 9478d0d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

packages/jacaranda/src/index.ts

+6-4
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,8 @@ type TokenConfig = {
164164
};
165165

166166
interface CreateTokensReturn {
167-
styles: typeof styles;
167+
sva: typeof styles;
168+
tokens: TokenConfig;
168169
}
169170

170171
// Helper to resolve token references in style objects
@@ -197,10 +198,10 @@ export function defineTokens<T extends TokenConfig>(tokenConfig: T): CreateToken
197198
...acc,
198199
[category]: values,
199200
};
200-
}, {} as any);
201+
}, {} as TokenConfig);
201202

202203
// Create a wrapped styles function that resolves token references
203-
const wrappedStyles: typeof styles = (config: any) => {
204+
const sva: typeof styles = (config: any) => {
204205
// Resolve tokens in base styles
205206
const resolvedBase = config.base ? resolveTokens(config.base, tokens) : config.base;
206207

@@ -236,6 +237,7 @@ export function defineTokens<T extends TokenConfig>(tokenConfig: T): CreateToken
236237
};
237238

238239
return {
239-
styles: wrappedStyles,
240+
sva,
241+
tokens,
240242
};
241243
}

0 commit comments

Comments
 (0)