Skip to content

Commit 66528c4

Browse files
committed
fix: code style
Signed-off-by: Innei <[email protected]>
1 parent 8b8ce23 commit 66528c4

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

src/components/ui/code-highlighter/shiki/Shiki.module.css

+5-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
}
1818

1919
.line {
20-
@apply block min-h-[1em];
20+
@apply block min-h-[1em] px-4;
2121
}
2222

2323
.highlighted,
@@ -71,4 +71,8 @@
7171
}
7272
}
7373
}
74+
75+
.scroll-container::-webkit-scrollbar-track {
76+
margin: 10px; /* 滚动条顶部间距 */
77+
}
7478
}

src/components/ui/code-highlighter/shiki/Shiki.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,9 @@ export const ShikiHighLighter: FC<Props> = (props) => {
152152
<div
153153
ref={setCodeBlockRef}
154154
className={clsxm(
155-
'relative max-h-[50vh] w-full overflow-auto px-4 scrollbar-none',
155+
'relative max-h-[50vh] w-full overflow-auto scrollbar-none',
156156
!isCollapsed ? '!max-h-[100%]' : isOverflow ? maskClassName : '',
157+
styles['scroll-container'],
157158
)}
158159
dangerouslySetInnerHTML={
159160
renderedHtml

src/components/ui/markdown/parsers/alert.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ const textColorMap = {
1818
} as any
1919

2020
const borderColorMap = {
21-
NOTE: 'border-blue-500 dark:border-blue-400',
22-
IMPORTANT: 'border-accent',
23-
WARNING: 'border-amber-500 dark:border-amber-400',
21+
NOTE: 'before:bg-blue-500 before:bg-blue-400',
22+
IMPORTANT: 'before:bg-accent',
23+
WARNING: 'before:bg-amber-500 dark:before:bg-amber-400',
2424
} as any
2525

2626
const typedIconMap = {

0 commit comments

Comments
 (0)