Skip to content

Commit c0d73d2

Browse files
authored
Improve tabs (#3735)
1 parent 454175a commit c0d73d2

File tree

8 files changed

+454
-224
lines changed

8 files changed

+454
-224
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export function Expandable(props: BlockProps<DocumentBlockExpandable>) {
5151
className={tcls(
5252
'inline-block',
5353
'size-3',
54-
'mr-2',
54+
'mr-3',
5555
'mb-1',
5656
'transition-transform',
5757
'shrink-0',
@@ -96,7 +96,7 @@ export function Expandable(props: BlockProps<DocumentBlockExpandable>) {
9696
document={document}
9797
ancestorBlocks={[...ancestorBlocks, block]}
9898
context={context}
99-
style={['px-10', 'pb-5', 'space-y-4']}
99+
style="space-y-4 px-10 pb-5"
100100
/>
101101
</Details>
102102
);

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { type ClassValue, tcls } from '@/lib/tailwind';
22
import type { DocumentBlockHeading, DocumentBlockTabs } from '@gitbook/api';
33
import { Icon } from '@gitbook/icons';
4+
import { Link } from '../primitives';
45
import { getBlockTextStyle } from './spacing';
56

67
/**
@@ -28,17 +29,19 @@ export function HashLinkButton(props: {
2829
'h-[1em]',
2930
'border-0',
3031
'opacity-0',
32+
'site-background',
33+
'rounded',
3134
'group-hover/hash:opacity-[0]',
3235
'group-focus/hash:opacity-[0]',
3336
'md:group-hover/hash:opacity-[1]',
3437
'md:group-focus/hash:opacity-[1]',
3538
className
3639
)}
3740
>
38-
<a
41+
<Link
3942
href={`#${id}`}
4043
aria-label={label}
41-
className={tcls('inline-flex', 'h-full', 'items-start', textStyle.lineHeight)}
44+
className={tcls('inline-flex h-full items-start', textStyle.lineHeight)}
4245
>
4346
<Icon
4447
icon="hashtag"
@@ -52,7 +55,7 @@ export function HashLinkButton(props: {
5255
iconClassName
5356
)}
5457
/>
55-
</a>
58+
</Link>
5659
</div>
5760
);
5861
}

0 commit comments

Comments
 (0)