Skip to content

Commit

Permalink
feat: Add an indent to the table of contents (#455)
Browse files Browse the repository at this point in the history
  • Loading branch information
shiquda authored Sep 17, 2024
1 parent 3d16aa9 commit 0bd1b14
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/renderer/src/components/ui/markdown/components/Toc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,14 @@ export const Toc: Component = ({ className }) => {
)}
>
{toc.map((heading, index) => (
<li key={heading.anchorId} className="flex h-[24px] w-full items-center">
<li
key={heading.anchorId}
className="flex w-full items-center"
style={{ paddingLeft: `${(heading.depth - rootDepth) * 12}px` }}
>
<button
className={cn(
"group flex w-full cursor-pointer justify-between",
"group flex w-full cursor-pointer justify-between py-1",
index === currentScrollRange[0] ? "text-accent" : "",
)}
type="button"
Expand Down

0 comments on commit 0bd1b14

Please sign in to comment.