From d59c5ba07d098b016207a66fadb29be005bed92c Mon Sep 17 00:00:00 2001 From: nanhaoluo <3075912108@qq.com> Date: Sat, 24 Jan 2026 23:33:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20Mermaid=20=E5=9B=BE=E8=A1=A8=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E5=AE=BD=E5=BA=A6=E5=9B=BA=E5=AE=9A=E3=80=81=E9=AB=98?= =?UTF-8?q?=E5=BA=A6=E8=87=AA=E9=80=82=E5=BA=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - SVG 宽度固定为 100%,适应容器宽度 - SVG 高度自动计算,根据内容自由伸展 - 移除所有高度限制,让图表完整显示 --- style.css | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/style.css b/style.css index b0ef617..dbd7c2d 100644 --- a/style.css +++ b/style.css @@ -919,17 +919,13 @@ article .wp-block-separator { max-width: 100%; opacity: 0; animation: mermaidFadeIn 0.3s ease-in-out forwards; - display: flex; - justify-content: center; - align-items: center; } .mermaid-container svg { + width: 100% !important; + height: auto !important; max-width: 100%; - max-height: 600px; - height: auto; display: block; - width: auto !important; } /* Mermaid 淡入动画 */ @@ -16636,19 +16632,13 @@ html.darkmode .mermaid-error-container .error-code code { overflow-x: auto; max-width: 100%; transition: opacity 0.3s ease-in; - display: flex; - justify-content: center; - align-items: center; - min-height: 100px; } .mermaid-container svg { + width: 100% !important; + height: auto !important; max-width: 100%; - max-height: 600px; - height: auto; - width: auto !important; display: block; - margin: 0 auto; } /* ---------- 卡片内的 Mermaid 图表 ---------- */ @@ -16672,11 +16662,6 @@ html.darkmode .mermaid-container { margin: 15px 0; border-radius: calc(var(--card-radius) * 0.8); } - - .mermaid-container svg { - max-width: 100%; - max-height: 500px; - } } @media screen and (max-width: 480px) { @@ -16684,10 +16669,6 @@ html.darkmode .mermaid-container { padding: 10px; margin: 10px 0; } - - .mermaid-container svg { - max-height: 400px; - } } /* ---------- Mermaid 错误提示样式 ---------- */