diff --git a/.changeset/little-mangos-type.md b/.changeset/little-mangos-type.md new file mode 100644 index 000000000..6b0f3894d --- /dev/null +++ b/.changeset/little-mangos-type.md @@ -0,0 +1,5 @@ +--- +"@vanilla-extract/css": patch +--- + +Swap the order of `createVar`'s overloads to enable inference of `VarDelcaration` type diff --git a/packages/css/src/vars.ts b/packages/css/src/vars.ts index 806ac4520..9b26eb1c5 100644 --- a/packages/css/src/vars.ts +++ b/packages/css/src/vars.ts @@ -38,11 +38,11 @@ const buildPropertyRule = ({ ...(initialValue != null ? { initialValue } : {}), }); +export function createVar(debugId?: string): CSSVarFunction; export function createVar( declaration: VarDeclaration, debugId?: string, ): CSSVarFunction; -export function createVar(debugId?: string): CSSVarFunction; export function createVar( debugIdOrDeclaration?: string | VarDeclaration, debugId?: string,