Skip to content

Commit 145ce6e

Browse files
authored
Lock mermaid diagram sizes. (#3514)
1 parent 5d33d4c commit 145ce6e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

webview-ui/src/components/common/MermaidBlock.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,4 +306,12 @@ const SvgContainer = styled.div<SvgContainerProps>`
306306
cursor: pointer;
307307
display: flex;
308308
justify-content: center;
309+
max-height: 400px;
310+
311+
/* Ensure the SVG scales within the container */
312+
& > svg {
313+
display: block; /* Ensure block layout */
314+
width: 100%;
315+
max-height: 100%; /* Respect container's max-height */
316+
}
309317
`

0 commit comments

Comments
 (0)