Skip to content

Commit 4e8377b

Browse files
authored
sprinkles: Fix types for custom properties passed to defineProperties (#1039)
1 parent 3163abc commit 4e8377b

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

.changeset/quiet-maps-drop.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@vanilla-extract/sprinkles': patch
3+
---
4+
5+
Fixes types for custom properties passed to `defineProperties`

packages/sprinkles/src/index.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,19 @@ type Condition = Partial<Record<ConditionKey, string>>;
2323

2424
type BaseConditions = { [conditionName: string]: Condition };
2525

26-
type AtomicProperties = {
26+
type AtomicCSSProperties = {
2727
[Property in keyof CSSProperties]?:
2828
| Record<string, CSSProperties[Property] | Omit<StyleRule, ConditionKey>>
2929
| ReadonlyArray<CSSProperties[Property]>;
3030
};
3131

32+
type AtomicCustomProperties = Record<
33+
string,
34+
Record<string | number, Omit<StyleRule, ConditionKey>>
35+
>;
36+
37+
type AtomicProperties = AtomicCSSProperties | AtomicCustomProperties;
38+
3239
type ShorthandOptions<
3340
Properties extends AtomicProperties,
3441
Shorthands extends { [shorthandName: string]: Array<keyof Properties> },

0 commit comments

Comments
 (0)