Skip to content

Commit 3f3f1c7

Browse files
authored
Fix toc on Learn (#2273)
## Description Before: <img width="603" height="230" alt="image" src="https://github.com/user-attachments/assets/65b65a22-ed38-4f72-8e3a-447581290498" /> After: <img width="616" height="254" alt="image" src="https://github.com/user-attachments/assets/45309179-da98-4ca8-ac29-a0c8f7ee980b" />
1 parent 73ab9f8 commit 3f3f1c7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/components/toc-hero/toc-hero-contents.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@ export function TocHeroContents({
2626
<ul
2727
className={clsx(
2828
"grid grid-flow-row-dense grid-rows-2 gap-px border-t border-inherit bg-neu-300 dark:bg-neu-100",
29-
sections.length > 3
29+
sections.length % 3 === 0
3030
? "grid-cols-2 lg:grid-cols-[repeat(3,1fr)]"
31-
: "grid-cols-1",
31+
: sections.length % 2 === 0
32+
? "grid-cols-2"
33+
: "grid-cols-1",
3234
)}
3335
>
3436
{sections.map((section, i) => {

0 commit comments

Comments
 (0)