Skip to content

Commit

Permalink
fix: vertical scrollbar on incorrect container in the code preview
Browse files Browse the repository at this point in the history
  • Loading branch information
Yugveer06 committed Dec 29, 2024
1 parent e0240b3 commit 184405e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/CodePreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const CodePreview = ({ language = "markdown", code }: Props) => {
language={language}
style={oneDark}
wrapLines={true}
customStyle={{ margin: "0" }}
customStyle={{ margin: "0", maxHeight: "20rem" }}
>
{codeString}
</SyntaxHighlighter>
Expand Down
7 changes: 5 additions & 2 deletions src/styles/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -557,18 +557,21 @@ body:has(.modal-overlay) {
border-radius: var(--br-md);
width: 100%;
overflow-x: auto;
max-height: 20rem;
position: relative;
}

.modal__copy {
position: absolute;
top: 0.5em;
right: 1em;
right: 1.2em;
z-index: 10;
isolation: isolate;
}

.modal__copy:hover {
background: var(--bg-primary);
}

.modal__tags {
display: flex;
gap: 0.5em;
Expand Down

0 comments on commit 184405e

Please sign in to comment.