Skip to content

Commit 441b7b9

Browse files
committed
fix: 画面の横幅が小さいときの画像とコードブロックのスタイルを改善
1 parent e4e0ec3 commit 441b7b9

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

website/src/components/ui/HtmlContent.tsx

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { FC } from "hono/jsx";
2+
import { twMerge } from "tailwind-merge";
23

34
export type HtmlContentProps = {
45
html: string;
@@ -7,7 +8,21 @@ export type HtmlContentProps = {
78
export const HtmlContent: FC<HtmlContentProps> = ({ html }) => {
89
return (
910
<div
10-
class="[&_img]:mx-auto [&_img]:block [&_img]:max-w-full"
11+
class={twMerge([
12+
"overflow-hidden",
13+
"[&_img]:mx-auto",
14+
"[&_img]:block",
15+
"[&_img]:max-w-full",
16+
"[&_img]:h-auto",
17+
"[&_img]:object-contain",
18+
"[&_img]:w-auto",
19+
"[&_pre]:overflow-x-auto",
20+
"[&_pre]:max-w-full",
21+
"[&_pre]:whitespace-pre-wrap",
22+
"[&_pre]:break-all",
23+
"[&_pre_code]:block",
24+
"[&_pre_code]:w-full",
25+
])}
1126
// biome-ignore lint/security/noDangerouslySetInnerHtml: typst-docsで生成されたHTMLを表示する
1227
dangerouslySetInnerHTML={{ __html: html }}
1328
/>

0 commit comments

Comments
 (0)