Skip to content

Commit 0b2c09e

Browse files
plesieckiaskoufis
andauthored
Enable the VarDeclaration type inference from the createVar parameters (#1646)
Co-authored-by: Adam Skoufis <[email protected]>
1 parent a440470 commit 0b2c09e

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/little-mangos-type.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@vanilla-extract/css": patch
3+
---
4+
5+
Swap the order of `createVar`'s overloads to enable inference of `VarDelcaration` type

packages/css/src/vars.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ const buildPropertyRule = ({
3838
...(initialValue != null ? { initialValue } : {}),
3939
});
4040

41+
export function createVar(debugId?: string): CSSVarFunction;
4142
export function createVar(
4243
declaration: VarDeclaration,
4344
debugId?: string,
4445
): CSSVarFunction;
45-
export function createVar(debugId?: string): CSSVarFunction;
4646
export function createVar(
4747
debugIdOrDeclaration?: string | VarDeclaration,
4848
debugId?: string,

0 commit comments

Comments
 (0)