Skip to content

Commit 21cbd9e

Browse files
authored
Change link color to primary subtle (#2809)
1 parent 38061bd commit 21cbd9e

File tree

10 files changed

+48
-53
lines changed

10 files changed

+48
-53
lines changed

.changeset/three-goats-relate.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+
Change link color to primary-subtle

packages/gitbook/src/components/Cookies/CookiesToast.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,13 @@ export function CookiesToast(props: { privacyPolicy?: string }) {
6666
'cookies_prompt',
6767
<a
6868
href={privacyPolicy}
69-
className={tcls('text-primary', 'hover:text-primary-strong', 'underline')}
69+
className={tcls(
70+
'text-primary-subtle',
71+
'hover:text-primary',
72+
'contrast-more:text-primary',
73+
'contrast-more:hover:text-primary-strong',
74+
'underline',
75+
)}
7076
>
7177
{t(language, 'cookies_prompt_privacy')}
7278
</a>,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export async function InlineLink(props: InlineProps<DocumentInlineLink>) {
2525
return (
2626
<Link
2727
href={resolved.href}
28-
className="underline underline-offset-2 text-primary hover:text-primary-strong transition-colors"
28+
className="underline underline-offset-2 text-primary-subtle hover:text-primary contrast-more:text-primary contrast-more:hover:text-primary-strong transition-colors"
2929
insights={{
3030
type: 'link_click',
3131
link: {

packages/gitbook/src/components/PageAside/ScrollSectionsList.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,16 @@ export function ScrollSectionsList(props: { sections: DocumentSection[] }) {
105105
],
106106

107107
activeId === section.id && [
108-
'text-primary',
109-
'hover:text-primary-strong',
108+
'text-primary-subtle',
109+
'hover:text-primary',
110+
'contrast-more:text-primary',
111+
'contrast-more:hover:text-primary-strong',
110112
'hover:bg-primary-hover',
111113
'tint:font-semibold',
112114
'contrast-more:font-semibold',
113115

114116
'sidebar-list-default:border-tint',
115-
'sidebar-list-pill:hover:bg-transparent',
117+
'sidebar-list-pill:hover:bg-primary-hover',
116118
],
117119
)}
118120
>

packages/gitbook/src/components/Search/SearchAskAnswer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export function SearchAskAnswer(props: { pointer: SiteContentPointer; query: str
9191

9292
const loading = (
9393
<div className={tcls('w-full', 'flex', 'items-center', 'justify-center')}>
94-
<Loading className={tcls('w-6', 'py-8', 'text-primary')} />
94+
<Loading className={tcls('w-6', 'py-8', 'text-primary-subtle')} />
9595
</div>
9696
);
9797

packages/gitbook/src/components/SiteSections/SiteSectionList.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export function SiteSectionListItem(props: {
8989
hover:text-tint-strong
9090
rounded-md straight-corners:rounded-none transition-all group/section-link`,
9191
isActive
92-
? `text-primary hover:text-primary-strong contrast-more:text-primary-strong font-semibold
92+
? `text-primary-subtle hover:text-primary contrast-more:text-primary contrast-more:hover:text-primary-strong font-semibold
9393
hover:bg-primary-hover contrast-more:hover:ring-1 contrast-more:hover:ring-primary-hover`
9494
: null,
9595
className,
@@ -109,7 +109,7 @@ export function SiteSectionListItem(props: {
109109
? `bg-primary ring-primary group-hover/section-link:ring-primary-hover,
110110
shadow-md shadow-primary
111111
contrast-more:ring-2 contrast-more:ring-primary
112-
text-primary contrast-more:text-primary-strong tint:bg-primary-solid tint:text-contrast-primary-solid`
112+
text-primary-subtle contrast-more:text-primary tint:bg-primary-solid tint:text-contrast-primary-solid`
113113
: null,
114114
)}
115115
>

packages/gitbook/src/components/SiteSections/SiteSectionTabs.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,9 @@ const SectionTab = React.forwardRef(function SectionTab(
149149
{...rest}
150150
className={tcls(
151151
'relative group flex select-none items-center justify-between rounded straight-corners:rounded-none px-3 py-1 my-2',
152-
isActive ? 'text-primary' : 'text-tint hover:bg-tint-hover hover:text-tint-strong',
152+
isActive
153+
? 'text-primary-subtle'
154+
: 'text-tint hover:bg-tint-hover hover:text-tint-strong',
153155
)}
154156
href={url}
155157
>
@@ -176,7 +178,9 @@ const SectionGroupTab = React.forwardRef(function SectionGroupTab(
176178
{...rest}
177179
className={tcls(
178180
'relative group flex select-none items-center justify-between rounded straight-corners:rounded-none transition-colors px-3 py-1 my-2',
179-
isActive ? 'text-primary' : 'text-tint hover:bg-tint-hover hover:text-tint-strong',
181+
isActive
182+
? 'text-primary-subtle'
183+
: 'text-tint hover:bg-tint-hover hover:text-tint-strong',
180184
)}
181185
>
182186
<span className="flex gap-2 items-center w-full truncate">
@@ -197,7 +201,9 @@ const SectionGroupTab = React.forwardRef(function SectionGroupTab(
197201
* Horizontal line indicating the active tab
198202
*/
199203
function ActiveTabIndicator() {
200-
return <span className="inset-x-3 -bottom-2 h-0.5 absolute bg-primary-11" />;
204+
return (
205+
<span className="inset-x-3 -bottom-2 h-0.5 absolute bg-primary-9 contrast-more:bg-primary-11" />
206+
);
201207
}
202208

203209
/**

packages/gitbook/src/components/TableOfContents/TOCPageIcon.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ export function TOCPageIcon({ page }: { page: RevisionPage }) {
1414
style={tcls(
1515
'text-base',
1616
'text-tint-strong/6',
17-
'group-aria-current-page/toclink:text-primary',
17+
'group-aria-current-page/toclink:text-primary-subtle',
18+
'contrast-more:group-aria-current-page/toclink:text-primary',
1819
'shrink-0',
1920
)}
2021
/>

packages/gitbook/src/components/TableOfContents/ToggleableLinkItem.tsx

Lines changed: 12 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -56,56 +56,29 @@ export function ToggleableLinkItem(
5656
insights={insights}
5757
{...(isActive ? { 'aria-current': 'page' } : {})}
5858
className={tcls(
59-
'group/toclink',
60-
'relative',
61-
'transition-colors',
62-
63-
'flex',
64-
'flex-row',
65-
'justify-between',
66-
67-
'p-1.5',
68-
'pl-3',
69-
'rounded-md',
70-
'straight-corners:rounded-none',
71-
72-
'text-sm',
73-
'font-normal',
74-
'text-balance',
75-
'text-tint-strong/7',
76-
'hover:text-tint-strong',
77-
'hover:bg-tint-hover',
78-
'contrast-more:text-tint-strong',
79-
80-
'hover:contrast-more:text-tint-strong',
81-
'hover:contrast-more:ring-1',
82-
'hover:contrast-more:ring-tint-12',
83-
84-
'before:contents[]',
85-
'before:absolute',
86-
'before:inset-y-0',
87-
'before:-left-px',
88-
89-
'[&+div_a]:pl-5',
90-
'sidebar-list-line:before:w-px',
91-
'sidebar-list-default:[&+div_a]:before:w-px',
92-
'sidebar-list-default:[&+div_a]:rounded-l-none',
93-
'sidebar-list-line:rounded-l-none',
59+
'group/toclink relative transition-colors',
60+
'flex flex-row justify-between',
61+
'p-1.5 pl-3 rounded-md straight-corners:rounded-none',
62+
'text-sm font-normal text-balance text-tint-strong/7 hover:text-tint-strong hover:bg-tint-hover contrast-more:text-tint-strong',
63+
'hover:contrast-more:text-tint-strong hover:contrast-more:ring-1 hover:contrast-more:ring-tint-12',
64+
'before:contents[] before:absolute before:inset-y-0 before:-left-px',
65+
'[&+div_a]:pl-5 sidebar-list-line:before:w-px sidebar-list-default:[&+div_a]:before:w-px sidebar-list-default:[&+div_a]:rounded-l-none sidebar-list-line:rounded-l-none',
9466

9567
isActive && [
9668
'font-semibold',
9769
'sidebar-list-line:before:w-0.5',
9870

9971
'before:bg-primary-solid',
100-
'text-primary',
72+
'text-primary-subtle',
73+
'contrast-more:text-primary',
10174
'sidebar-list-pill:bg-primary',
102-
'sidebar-list-pill:text-primary',
10375

10476
'hover:bg-primary-hover',
105-
'hover:text-primary-strong',
77+
'hover:text-primary',
10678
'hover:before:bg-primary-solid-hover',
79+
'sidebar-list-pill:hover:bg-primary-hover',
10780

108-
'contrast-more:text-primary-strong',
81+
'contrast-more:text-primary',
10982
'contrast-more:hover:text-primary-strong',
11083
'contrast-more:bg-primary',
11184
'contrast-more:ring-1',

packages/gitbook/src/components/primitives/StyledLink.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ export function StyledLink(props: Omit<LinkProps, 'style'> & { style?: ClassValu
1515
'underline',
1616
'underline-offset-2',
1717
'decoration-primary/6',
18-
'text-primary',
19-
'hover:text-primary-strong',
18+
'text-primary-subtle',
19+
'hover:text-primary',
20+
'contrast-more:text-primary',
21+
'contrast-more:hover:text-primary-strong',
2022
'transition-colors',
2123
style,
2224
)}

0 commit comments

Comments
 (0)