Skip to content

Commit 13c7534

Browse files
authored
Use ellipsis and fix icon color for more links in the header on small screen (#2455)
1 parent 4cbcc5b commit 13c7534

File tree

5 files changed

+30
-8
lines changed

5 files changed

+30
-8
lines changed

.changeset/dull-gifts-flow.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+
Use ellipsis and fix icon color for more links in the header on small screen

bun.lockb

144 Bytes
Binary file not shown.

package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,5 @@
2828
},
2929
"patchedDependencies": {
3030
"@vercel/[email protected]": "patches/@vercel%[email protected]"
31-
},
32-
"dependencies": {
33-
"@scalar/api-client-react": "0.3.7"
3431
}
3532
}

packages/gitbook/src/components/Header/Header.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ export function Header(props: {
9595
label={t(getSpaceLanguage(customization), 'more')}
9696
links={customization.header.links}
9797
context={context}
98+
customization={customization}
9899
/>
99100
</HeaderLinks>
100101
<div

packages/gitbook/src/components/Header/HeaderLinkMore.tsx

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1-
import { CustomizationHeaderLink } from '@gitbook/api';
1+
import {
2+
CustomizationHeaderLink,
3+
CustomizationHeaderPreset,
4+
CustomizationSettings,
5+
SiteCustomizationSettings,
6+
} from '@gitbook/api';
7+
import { Icon } from '@gitbook/icons';
28
import React from 'react';
39

410
import { ContentRefContext, resolveContentRef } from '@/lib/references';
11+
import { tcls } from '@/lib/tailwind';
512

6-
import { Dropdown, DropdownChevron, DropdownMenu, DropdownMenuItem } from './Dropdown';
13+
import { Dropdown, DropdownMenu, DropdownMenuItem } from './Dropdown';
714
import styles from './headerLinks.module.css';
815

916
/**
@@ -13,13 +20,25 @@ export function HeaderLinkMore(props: {
1320
label: React.ReactNode;
1421
links: CustomizationHeaderLink[];
1522
context: ContentRefContext;
23+
customization: CustomizationSettings | SiteCustomizationSettings;
1624
}) {
17-
const { label, links, context } = props;
25+
const { label, links, context, customization } = props;
26+
27+
const isCustomizationDefault =
28+
customization.header.preset === CustomizationHeaderPreset.Default;
1829

1930
const renderButton = () => (
20-
<button className="px-1">
31+
<button
32+
className={tcls(
33+
'px-1',
34+
!isCustomizationDefault
35+
? ['text-header-link-500']
36+
: ['text-dark/8', 'dark:text-light/8', 'dark:hover:text-light'],
37+
'hover:text-header-link-400',
38+
)}
39+
>
2140
<span className="sr-only">{label}</span>
22-
<DropdownChevron />
41+
<Icon icon="ellipsis" className={tcls('opacity-6', 'size-3', 'ms-1')} />
2342
</button>
2443
);
2544

0 commit comments

Comments
 (0)