Skip to content

Commit 4bb4aba

Browse files
JusterZhuclaude
andcommitted
feat(docs): add horizontal scroll + zoom interaction for mermaid flowcharts
The Core-flow page has 11 wide horizontal mermaid flowcharts that were squished into the content column, making them unreadable. - Set .docusaurus-mermaid-container to overflow-x: auto - Let SVG keep natural width (min-width: 600px) - Add styled scrollbar for desktop - Subtle hover shadow for visual feedback Co-Authored-By: Claude <noreply@anthropic.com>
1 parent d470941 commit 4bb4aba

1 file changed

Lines changed: 54 additions & 0 deletions

File tree

website/src/css/custom.css

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,60 @@
636636
color: var(--ifm-color-primary);
637637
}
638638

639+
/* ════════════════════════════════════════════════════════════════
640+
MERMAID DIAGRAMS — horizontal scroll + zoom on hover
641+
════════════════════════════════════════════════════════════════ */
642+
643+
/* Wrapper around each mermaid SVG: enable horizontal scroll */
644+
.docusaurus-mermaid-container {
645+
overflow-x: auto;
646+
overflow-y: hidden;
647+
-webkit-overflow-scrolling: touch;
648+
margin: 1.5rem 0;
649+
border: 1px solid var(--ifm-color-emphasis-200);
650+
border-radius: var(--gu-radius);
651+
background: #fff;
652+
padding: 0.5rem;
653+
}
654+
655+
[data-theme='dark'] .docusaurus-mermaid-container {
656+
background: #1a1a2e;
657+
border-color: rgba(93, 173, 226, 0.15);
658+
}
659+
660+
/* Allow the SVG to keep its natural width (don't shrink to container) */
661+
.docusaurus-mermaid-container svg {
662+
width: auto !important;
663+
max-width: none !important;
664+
height: auto !important;
665+
min-width: 600px; /* Ensures diagrams don't get squashed too small */
666+
display: block;
667+
}
668+
669+
/* Zoom-on-hover: scale up slightly for readability */
670+
.docusaurus-mermaid-container:hover {
671+
box-shadow: 0 2px 12px rgba(0,0,0,0.12);
672+
}
673+
[data-theme='dark'] .docusaurus-mermaid-container:hover {
674+
box-shadow: 0 2px 12px rgba(0,0,0,0.35);
675+
}
676+
677+
/* Make the scrollbar visible and styled */
678+
.docusaurus-mermaid-container::-webkit-scrollbar {
679+
height: 8px;
680+
}
681+
.docusaurus-mermaid-container::-webkit-scrollbar-track {
682+
background: var(--ifm-color-emphasis-100);
683+
border-radius: 4px;
684+
}
685+
.docusaurus-mermaid-container::-webkit-scrollbar-thumb {
686+
background: var(--ifm-color-emphasis-400);
687+
border-radius: 4px;
688+
}
689+
.docusaurus-mermaid-container::-webkit-scrollbar-thumb:hover {
690+
background: var(--ifm-color-emphasis-500);
691+
}
692+
639693
/* ════════════════════════════════════════════════════════════════
640694
PRINT-FRIENDLY
641695
════════════════════════════════════════════════════════════════ */

0 commit comments

Comments
 (0)