Skip to content

Commit 184405e

Browse files
committed
fix: vertical scrollbar on incorrect container in the code preview
1 parent e0240b3 commit 184405e

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/components/CodePreview.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const CodePreview = ({ language = "markdown", code }: Props) => {
1717
language={language}
1818
style={oneDark}
1919
wrapLines={true}
20-
customStyle={{ margin: "0" }}
20+
customStyle={{ margin: "0", maxHeight: "20rem" }}
2121
>
2222
{codeString}
2323
</SyntaxHighlighter>

src/styles/main.css

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -557,18 +557,21 @@ body:has(.modal-overlay) {
557557
border-radius: var(--br-md);
558558
width: 100%;
559559
overflow-x: auto;
560-
max-height: 20rem;
561560
position: relative;
562561
}
563562

564563
.modal__copy {
565564
position: absolute;
566565
top: 0.5em;
567-
right: 1em;
566+
right: 1.2em;
568567
z-index: 10;
569568
isolation: isolate;
570569
}
571570

571+
.modal__copy:hover {
572+
background: var(--bg-primary);
573+
}
574+
572575
.modal__tags {
573576
display: flex;
574577
gap: 0.5em;

0 commit comments

Comments
 (0)