Skip to content

Commit

Permalink
Sticky sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
kamranahmedse committed Apr 4, 2024
1 parent abad548 commit ff94ea7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/TableOfContent/TableOfContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function TableOfContent(props: TableOfContentProps) {
className={cn(
'relative min-w-[250px] px-5 pt-0 max-lg:min-w-full max-lg:max-w-full max-lg:border-none max-lg:px-0 lg:pt-10',
{
'top-0 lg:sticky': totalRows <= 20,
'top-0 lg:!sticky': totalRows <= 20,
},
)}
>
Expand All @@ -46,7 +46,7 @@ export function TableOfContent(props: TableOfContentProps) {

<ol
className={cn(
'mt-2 space-y-1 max-lg:absolute max-lg:top-full max-lg:mt-0 max-lg:w-full max-lg:space-y-0 max-lg:bg-white max-lg:shadow',
'mt-2 max-lg:absolute max-lg:top-full max-lg:mt-0 max-lg:w-full space-y-0.5 max-lg:bg-white max-lg:shadow',
!isOpen && 'hidden lg:block',
isOpen && 'block',
)}
Expand All @@ -68,7 +68,7 @@ export function TableOfContent(props: TableOfContentProps) {
</a>

{heading.children.length > 0 && (
<ol className="my-0 ml-4 mt-1 space-y-1 max-lg:ml-0 max-lg:mt-0 max-lg:list-none max-lg:space-y-0">
<ol className="my-0 ml-4 mt-1 max-lg:ml-0 max-lg:mt-0 max-lg:list-none space-y-0.5">
{heading.children.map((children) => {
return (
<li key={children.slug}>
Expand Down

0 comments on commit ff94ea7

Please sign in to comment.