Skip to content

Commit

Permalink
Feat: Table of content component design change (#705)
Browse files Browse the repository at this point in the history
* Feat:Upgrading tableOfContent component

* bug fixes

* improving design

* adding original text-color
  • Loading branch information
DhairyaMajmudar authored May 24, 2024
1 parent 661bbc6 commit 6c06644
Showing 1 changed file with 24 additions and 5 deletions.
29 changes: 24 additions & 5 deletions components/StyledMarkdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ const StyledMarkdownBlock = ({ markdown }: { markdown: string }) => {
const fullMarkdown = useContext(FullMarkdownContext);
if (!fullMarkdown) return null;
return (
<div className='text-blue-500 mt-3 bg-slate-50 dark:bg-slate-900 pt-6 pb-3 px-3 rounded-l border-l-blue-400 border-l-[3px]'>
<div className='mt-3 bg-slate-50 dark:bg-slate-900 pt-6 pb-3 pr-3 border-dotted border-l-blue-400 border-l-[3px]'>
<TableOfContentMarkdown
markdown={fullMarkdown}
depth={depth}
Expand Down Expand Up @@ -530,8 +530,11 @@ export function TableOfContentMarkdown({
return (
<a
href={`#${slug}`}
className='block cursor-pointer mb-3 text-sm leading-4 text-slate-700 hover:text-blue-500'
className='block cursor-pointer mb-3 text-sm leading-4 ml-[-0.40rem] font-bold'
>
<span className='mr-1 text-blue-400 text-[1.5em]'>
&#9679;
</span>
{children}
</a>
);
Expand All @@ -543,8 +546,9 @@ export function TableOfContentMarkdown({
return (
<a
href={`#${slug}`}
className='block cursor-pointer mb-3 text-sm leading-4 ml-3 hover:text-blue-500'
className='block cursor-pointer mb-3 text-sm leading-4 -ml-[7px] font-bold'
>
<span className='mr-1 text-blue-400 text-[1em]'>&#9679;</span>
{children}
</a>
);
Expand All @@ -559,8 +563,15 @@ export function TableOfContentMarkdown({
return (
<a
href={`#${slug}`}
className='block cursor-pointer mb-3 text-sm leading-4 ml-7 hover:text-blue-500'
className='flex flex-row items-center cursor-pointer mb-3 text-sm leading-4 ml-[-0.15rem]'
>
<span className='text-blue-400 text-[0.29em] ml-1'>
&#9679; &#9679; &#9679; &#9679;
</span>
<span className='mr-1 text-blue-400 text-[0.75em]'>
&#9679;
</span>

{children}
</a>
);
Expand All @@ -575,8 +586,16 @@ export function TableOfContentMarkdown({
return (
<a
href={`#${slug}`}
className='block cursor-pointer mb-3 text-sm leading-4 ml-10 hover:text-blue-500'
className='flex flex-row items-center cursor-pointer mb-3 text-sm leading-4 ml-[-0.15rem] '
>
<span className='text-blue-400 text-[0.35em] ml-1'>
&#9679; &#9679; &#9679; &#9679; &#9679; &#9679;
&#9679; &#9679; &#9679; &#9679; &#9679;
</span>
<span className='mr-1 text-blue-400 text-[0.75em]'>
&#9679;
</span>

{children}
</a>
);
Expand Down

0 comments on commit 6c06644

Please sign in to comment.