astahmer / pandabox

a toolbox for Panda CSS
https://pandabox.vercel.app/
48 stars 3 forks source link

A short README for utils (CSS var utility functions) #34

Closed apatrida closed 6 months ago

apatrida commented 6 months ago

I think I know what this does: packages/utils

But I can't be sure I know what that does.

Can we get a short README describing the functions there?

astahmer commented 6 months ago

assignInlineVars is like https://vanilla-extract.style/documentation/packages/dynamic/#assigninlinevars but type-safe with typings using your panda.config tokens https://github.com/astahmer/pandabox/blob/main/packages/utils/__tests__/assign-inline-vars.test.ts

cssVar allows creating creating css vars as JS objects so you can reference them in your panda config or at runtime

wrapValue will wrap every objects inside the first argument with a { value: xxx }, mostly meant to easily migrate from a chakra theme tokens object to a panda.config tokens object

apatrida commented 6 months ago

thanks!