Skip to content

Commit a28a997

Browse files
authored
Add margin to adjacent buttons (#3316)
1 parent 28a9ee7 commit a28a997

File tree

2 files changed

+22
-13
lines changed

2 files changed

+22
-13
lines changed

.changeset/purple-cougars-breathe.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"gitbook": patch
3+
---
4+
5+
Add margin to adjacent buttons

packages/gitbook/src/components/DocumentView/InlineButton.tsx

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,22 @@ export async function InlineButton(props: InlineProps<api.DocumentInlineButton>)
1717
}
1818

1919
return (
20-
<Button
21-
href={resolved.href}
22-
label={inline.data.label}
23-
// TODO: use a variant specifically for user-defined buttons.
24-
variant={inline.data.kind}
25-
insights={{
26-
type: 'link_click',
27-
link: {
28-
target: inline.data.ref,
29-
position: api.SiteInsightsLinkPosition.Content,
30-
},
31-
}}
32-
/>
20+
// Set the leading to have some vertical space between adjacent buttons
21+
<span className="inline-button leading-[3rem] [&:has(+.inline-button)]:mr-2">
22+
<Button
23+
href={resolved.href}
24+
label={inline.data.label}
25+
// TODO: use a variant specifically for user-defined buttons.
26+
variant={inline.data.kind}
27+
className="leading-normal"
28+
insights={{
29+
type: 'link_click',
30+
link: {
31+
target: inline.data.ref,
32+
position: api.SiteInsightsLinkPosition.Content,
33+
},
34+
}}
35+
/>
36+
</span>
3337
);
3438
}

0 commit comments

Comments
 (0)