Skip to content

Commit 4886922

Browse files
Fixed Graphql api docs sidebar UI (#1085)
<!-- Explain the changes introduced in your PR --> ## Pull Request approval You will need to get your PR approved by at least one member of the Sourcegraph team. For reviews of docs formatting, styles, and component usage, please tag the docs team via the #docs Slack channel. --------- Co-authored-by: Maedah Batool <[email protected]>
1 parent 7c7ee33 commit 4886922

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

src/app/api/graphql/api-docs/page.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ const PostLayout = () => {
1515
<div id="page" className="drawer-layout">
1616
<div id="sidebar">
1717
<div className="sidebar-top-container">
18-
<h3 className="text-sm uppercase">Table of Contents</h3>
18+
<h2 className="font-display text-sm font-medium text-slate-900 dark:text-white">Table of Contents</h2>
19+
1920

2021
{/* <div id="logo"></div>
2122
<button className="close-button" type="button">

src/components/Prose.tsx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export function Prose<T extends React.ElementType = 'div'>({
2121
// lead
2222
'prose-lead:text-slate-500 dark:prose-lead:text-dark-paragraph-text',
2323
// links
24-
'prose-a:font-semibold prose-a:text-vermilion-00 hover:prose-a-text:[#606060] visited:text-[#4A4A4A] hover:visited:text-[#606060] dark:prose-a:vermilion-11 dark:hover:prose-a:dark-text-secondary dark:visited:text-[#606060] dark:hover:visited:text-[#A9A9A9]',
24+
'prose-a:font-semibold prose-a:text-vermilion-00 hover:prose-a-text:[#606060] visited:text-[#4A4A4A] hover:visited:text-[#606060] dark:prose-a:text-vermilion-11 dark:hover:prose-a:text-dark-text-secondary dark:visited:text-[#606060] dark:hover:visited:text-[#A9A9A9]',
2525
// link underline
2626
'prose-a:underline hover:prose-a:text-[#606060] hover:prose-a:underline dark:prose-a:underline dark:hover:prose-a:underline',
2727
// pre
@@ -35,7 +35,19 @@ export function Prose<T extends React.ElementType = 'div'>({
3535
// Inline code block
3636
'prose-code:before:content-none prose-code:after:content-none',
3737
// Video
38-
'prose-video:rounded-xl'
38+
'prose-video:rounded-xl',
39+
40+
// Specific styles for the API docs navigation
41+
// Remove bullets from all nav items
42+
'[&_#nav_ul]:list-none [&_#nav_ul]:pl-0 [&_#nav_ul]:ml-0',
43+
44+
// Style all nav links
45+
'[&_#nav_a]:font-normal [&_#nav_a]:text-slate-500 hover:[&_#nav_a]:text-slate-700 dark:[&_#nav_a]:text-dark-text-secondary dark:hover:[&_#nav_a]:text-slate-300',
46+
'[&_#nav_a]:no-underline hover:[&_#nav_a]:underline dark:hover:[&_#nav_a]:underline',
47+
48+
// Specific style for h5.nav-group-section-title links (to match TOC h3)
49+
'[&_#nav_h5.nav-group-section-title_a]:font-normal [&_#nav_h5.nav-group-section-title_a]:text-slate-500 hover:[&_#nav_h5.nav-group-section-title_a]:text-slate-700 dark:[&_#nav_h5.nav-group-section-title_a]:text-dark-text-secondary dark:hover:[&_#nav_h5.nav-group-section-title_a]:text-slate-300',
50+
'[&_#nav_h5.nav-group-section-title_a]:no-underline hover:[&_#nav_h5.nav-group-section-title_a]:underline dark:hover:[&_#nav_h5.nav-group-section-title_a]:underline',
3951
)}
4052
{...props}
4153
/>

0 commit comments

Comments
 (0)