Skip to content

Commit 2966b85

Browse files
Remove extra space below unexpanded API docs Show more
The button and its Collapse were siblings in a VStack. Chakra's margin-based spacing was cancelled on the collapse with marginTop: 0, but Panda's VStack uses real flex gap, so the zero-height collapsed div still cost a 12px gap below the button. Wrap the pair in one Box so the gap applies once above the group; the expanded spacing still comes from the inner mt that animates with the collapse.
1 parent 6fa95d2 commit 2966b85

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/documentation/api/ApiNode.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,11 +215,13 @@ const ApiNodeSelf = ({
215215
/>
216216
)}
217217
{(hasShowMoreContent || hasSignatureDetail) && (
218-
<>
218+
// One flex child: the stack gap must not apply between the button
219+
// and the collapse (zero-height when closed, and the expand margin
220+
// should animate inside it).
221+
<Box>
219222
<ShowMoreButton onClick={onToggleShowMore} isOpen={showMore} />
220223
{hasShowMoreContent && (
221-
// Avoid VStack spacing here so the margin animates too.
222-
<Collapse isOpen={showMore} style={{ marginTop: 0 }}>
224+
<Collapse isOpen={showMore}>
223225
<VStack gap="3" mt="3" alignItems="stretch">
224226
{hasRemainder && (
225227
<DocString
@@ -235,7 +237,7 @@ const ApiNodeSelf = ({
235237
</VStack>
236238
</Collapse>
237239
)}
238-
</>
240+
</Box>
239241
)}
240242
</VStack>
241243
);

0 commit comments

Comments
 (0)