Skip to content

Commit

Permalink
fix: code scrollbar align
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <i@innei.in>
  • Loading branch information
Innei committed Mar 17, 2024
1 parent e76df6f commit 2d9fa2f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions src/components/ui/code-highlighter/shiki/Shiki.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,12 @@
}
}

.scroll-container::-webkit-scrollbar-track {
margin: 10px; /* 滚动条顶部间距 */
.scroll-container pre::-webkit-scrollbar-track {
margin-left: 3rem;
margin-right: 8rem;
}

.scroll-container pre::-webkit-scrollbar {
background-color: transparent !important;
}
}
2 changes: 1 addition & 1 deletion src/components/ui/code-highlighter/shiki/Shiki.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export const ShikiHighLighter: FC<Props> = (props) => {
<div
ref={setCodeBlockRef}
className={clsxm(
'relative max-h-[50vh] w-full overflow-auto scrollbar-none',
'relative max-h-[50vh] w-full overflow-auto',
!isCollapsed ? '!max-h-[100%]' : isOverflow ? maskClassName : '',
styles['scroll-container'],
)}
Expand Down

0 comments on commit 2d9fa2f

Please sign in to comment.