diff --git a/.changeset/tricky-schools-tap.md b/.changeset/tricky-schools-tap.md new file mode 100644 index 0000000..fb81ccf --- /dev/null +++ b/.changeset/tricky-schools-tap.md @@ -0,0 +1,5 @@ +--- +"@svbstrate/core": patch +--- + +Fix bug in `pick` where `customProperties` weren't included, plus widen `customProperties` value to `SvbstrateValue` diff --git a/packages/core/lib/index.ts b/packages/core/lib/index.ts index 07497c3..d05c453 100644 --- a/packages/core/lib/index.ts +++ b/packages/core/lib/index.ts @@ -216,7 +216,8 @@ export function pick( theme.macros[prop as keyof types.Macros] || theme.variants[prop as keyof types.Variants] || theme.shorthands[prop as keyof types.Shorthands] || - theme.properties[prop as keyof types.CSSProperties] + theme.properties[prop as keyof types.CSSProperties] || + theme.customProperties[prop as keyof types.CustomProperties] ) { styles[prop] = props[prop] as types.SvbstrateStyleObject; } else { diff --git a/packages/core/lib/types.ts b/packages/core/lib/types.ts index 3f0d68b..e090ddd 100644 --- a/packages/core/lib/types.ts +++ b/packages/core/lib/types.ts @@ -161,7 +161,7 @@ export interface ThemeConfig { }; customProperties: { [Property in keyof CustomProperties]: ( - value: Value, + value: SvbstrateValue, theme: Tokens ) => SvbstrateStyleObject; };