Skip to content

Commit

Permalink
fix: pass value through to margin in <Stack>
Browse files Browse the repository at this point in the history
  • Loading branch information
aulneau committed Jun 26, 2021
1 parent 95a99bf commit f931545
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/poor-dingos-rescue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@stacks/ui': minor
---

This fixes a bug where if a pixel or other non named value was passes to Stack, it would not apply.
2 changes: 1 addition & 1 deletion packages/ui/src/stack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const Stack: ForwardRefExoticComponentWithAs<StackProps, 'div'> = forward

const spacingProps = useCallback(
(theme: Theme) => {
const value = get(theme, 'space')[spacing as string];
const value = get(theme, 'space')[spacing as string] || spacing; // if get returns undefined, pass the spacing value (could be a pixel value);
return isInline
? {
marginTop: 0,
Expand Down

0 comments on commit f931545

Please sign in to comment.