UI: Fix TOC overflow problems

This commit is contained in:
fuma-nama
2024-07-23 12:44:46 +08:00
parent 3f7c000e9d
commit 3519e6c6ab
2 changed files with 6 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'fumadocs-ui': patch
---
Fix TOC overflow problems
+1 -1
View File
@@ -154,7 +154,7 @@ function TOCItem({ item }: { item: TOCItemType }): React.ReactElement {
<Primitive.TOCItem
href={item.url}
className={cn(
'py-1 transition-colors data-[active=true]:font-medium data-[active=true]:text-primary',
'py-1 transition-colors [overflow-wrap:anywhere] data-[active=true]:font-medium data-[active=true]:text-primary',
item.depth <= 2 && 'ps-4',
item.depth === 3 && 'ps-7',
item.depth >= 4 && 'ps-10',