Skip to content
Merged
2 changes: 1 addition & 1 deletion src/components/templates/BaseTemplate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export const BaseTemplate: FC<BaseTemplateProps> = ({
x-transition:leave-end="opacity-0"
x-on:click="sidebarOpen = false"
/>
<div class="container mx-auto max-w-8xl px-4 sm:px-6 lg:px-8 flex relative">
<div class="container mx-auto max-w-8xl px-4 sm:px-6 lg:px-8 lg:flex relative">
<div
x-cloak
class="fixed inset-y-0 left-0 w-64 bg-white shadow-xl z-30 transform transition-transform duration-300 ease-in-out lg:hidden"
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/HtmlContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const HtmlContent: FC<HtmlContentProps> = ({ html }) => {
"[&_img]:w-auto",
"[&_pre]:overflow-x-auto",
"[&_pre]:max-w-full",
"[&_pre]:whitespace-pre-wrap",
"[&_pre]:whitespace-pre",
"[&_pre]:break-all",
"[&_pre_code]:block",
"[&_pre_code]:w-full",
Expand Down
20 changes: 19 additions & 1 deletion src/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,23 @@ samp {
}
}

/* Previewed code block with side-by-side layout */
.previewed-code {
@apply rounded-md overflow-hidden flex flex-col lg:flex-row lg:flex-wrap mb-4;
}

.previewed-code pre {
@apply flex-1 m-0 rounded-none whitespace-pre overflow-x-auto lg:flex-[1_0_auto];
}

.previewed-code .preview {
@apply flex-1 flex-wrap bg-gray-200 flex items-center justify-center p-4 lg:min-w-1/2;
}

.previewed-code .preview img {
@apply max-w-full max-h-96 my-2;
}

/*
Code block styles for Typst Light theme

Expand Down Expand Up @@ -170,6 +187,7 @@ pre code span.typ-error {
border-radius: 2px;
}
pre {
background: #f6f8fa;
/* Override typst-docs provided styles. */
background: #f6f8fa !important;
color: #1f2328;
}