fix(docs): center and auto-fit mermaid SVG to fullscreen on open#137
Merged
Conversation
Replace the basic scrollbar approach with a full interactive viewer: - Click any mermaid diagram to open a fullscreen modal overlay - Pan (drag) and zoom (scroll/+/- buttons) to freely explore - Toolbar with zoom in/out/reset/close buttons - Escape key to close, +/=/- keyboard shortcuts - Dark/light theme support - Smooth overlay animation Co-Authored-By: Claude <noreply@anthropic.com>
Previously the modal body was only 90vw x 85vh with nested scrollable divs, and the SVG rendered at its tiny native size in the top-left corner. Fixes: - Modal now covers the entire viewport (100vw x 100vh) - On open, auto-scale SVG to fit available space using viewBox dimensions - SVG is centered both horizontally and vertically - Window resize also re-fits the SVG - Replaced the old 'reset' button with a 'fit to screen' button (0) - Keyboard shortcut 0 to re-fit Co-Authored-By: Claude <noreply@anthropic.com>
This was referenced Jun 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
PR #136 added click-to-zoom, but the SVG rendered small in the top-left corner of the modal instead of filling the screen.
Fix
0) to re-center after manual pan/zoomBefore
SVG rendered at tiny native size in a small box
After
SVG fills the entire screen, centered, with the same zoom/pan/drag interactions
🤖 Generated with Claude Code