Skip to content

Commit

Permalink
fix: code scroll overflow handling (#620)
Browse files Browse the repository at this point in the history
Co-authored-by: dicedtomato <35403473+diced@users.noreply.github.com>
  • Loading branch information
quantum5 and diced authored Oct 16, 2024
1 parent 145b1ca commit b661562
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/render/PrismCode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default function PrismCode({ code, ext, ...props }) {

return (
<Prism
sx={(t) => ({ height: '100vh', backgroundColor: t.colors.dark[8] })}
sx={(t) => ({ height: '100vh', overflow: 'scroll', backgroundColor: t.colors.dark[8] })}
withLineNumbers
language={exts[ext]?.toLowerCase()}
{...props}
Expand Down
4 changes: 2 additions & 2 deletions src/pages/code/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ export default function Code({ code, id, title, render, renderType }) {

{!render && (
<PrismCode
sx={(t) => ({ height: '100vh', backgroundColor: t.colors.dark[8] })}
sx={(t) => ({ height: '100vh', overflow: 'scroll', backgroundColor: t.colors.dark[8] })}
code={code}
ext={id.split('.').pop()}
/>
)}

{render && overrideRender && (
<PrismCode
sx={(t) => ({ height: '100vh', backgroundColor: t.colors.dark[8] })}
sx={(t) => ({ height: '100vh', overflow: 'scroll', backgroundColor: t.colors.dark[8] })}
code={code}
ext={id.split('.').pop()}
/>
Expand Down

0 comments on commit b661562

Please sign in to comment.