Skip to content

Commit

Permalink
fix: pick bug
Browse files Browse the repository at this point in the history
  • Loading branch information
estrattonbailey committed Apr 11, 2023
1 parent 828be44 commit 8f46050
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/tricky-schools-tap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@svbstrate/core": patch
---

Fix bug in `pick` where `customProperties` weren't included, plus widen `customProperties` value to `SvbstrateValue`
3 changes: 2 additions & 1 deletion packages/core/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ export function pick<T = types.UnknownKeyValue>(
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 {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export interface ThemeConfig {
};
customProperties: {
[Property in keyof CustomProperties]: (
value: Value,
value: SvbstrateValue,
theme: Tokens
) => SvbstrateStyleObject;
};
Expand Down

0 comments on commit 8f46050

Please sign in to comment.