|
| 1 | +--- |
| 2 | +/** |
| 3 | + * Inline SVG stack diagram — uses currentColor to inherit text color from the |
| 4 | + * parent element, which is styled via external CSS. This avoids Safari bugs |
| 5 | + * where @media (prefers-color-scheme) doesn't work inside SVG elements. |
| 6 | + */ |
| 7 | +--- |
| 8 | +<div class="stack-diagram-wrapper" style="max-width: 520px; margin: 1.5rem auto;"> |
| 9 | + <svg width="100%" viewBox="-100 0 580 340" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="A stack of pull requests: main at the bottom, with auth-layer (PR #1), api-endpoints (PR #2), and frontend (PR #3) stacked on top"> |
| 10 | + <style> |
| 11 | + text { font-family: 'Mona Sans', -apple-system, "system-ui", "Segoe UI", sans-serif; } |
| 12 | + .trunk-box { fill: rgba(128,128,128,0.1); stroke: rgba(128,128,128,0.4); stroke-width: 1; } |
| 13 | + .trunk-text { fill: currentColor; font-size: 14px; font-weight: 600; } |
| 14 | + .branch-box { fill: rgba(9,105,218,0.12); stroke: #0969da; stroke-width: 1; } |
| 15 | + .branch-text { fill: currentColor; font-size: 14px; font-weight: 600; } |
| 16 | + .arrow-line { stroke: currentColor; stroke-width: 1.5; opacity: 0.4; } |
| 17 | + .arrow-marker { stroke: currentColor; stroke-opacity: 0.9; } |
| 18 | + .annotation { fill: currentColor; font-size: 14px; font-style: italic; opacity: 0.6; font-weight: 600; } |
| 19 | + </style> |
| 20 | + <defs> |
| 21 | + <marker id="arrow" viewBox="0 0 10 10" refX="8" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse"> |
| 22 | + <path d="M2 1L8 5L2 9" fill="none" class="arrow-marker" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> |
| 23 | + </marker> |
| 24 | + </defs> |
| 25 | + |
| 26 | + <g> |
| 27 | + <rect x="80" y="262" width="220" height="44" rx="8" class="trunk-box"/> |
| 28 | + <text x="190" y="284" text-anchor="middle" dominant-baseline="central" class="trunk-text">main</text> |
| 29 | + </g> |
| 30 | + |
| 31 | + <g> |
| 32 | + <rect x="80" y="188" width="220" height="44" rx="8" class="branch-box"/> |
| 33 | + <text x="190" y="210" text-anchor="middle" dominant-baseline="central" class="branch-text">PR #1 · auth-layer</text> |
| 34 | + </g> |
| 35 | + |
| 36 | + <g> |
| 37 | + <rect x="80" y="114" width="220" height="44" rx="8" class="branch-box"/> |
| 38 | + <text x="190" y="136" text-anchor="middle" dominant-baseline="central" class="branch-text">PR #2 · api-endpoints</text> |
| 39 | + </g> |
| 40 | + |
| 41 | + <g> |
| 42 | + <rect x="80" y="40" width="220" height="44" rx="8" class="branch-box"/> |
| 43 | + <text x="190" y="62" text-anchor="middle" dominant-baseline="central" class="branch-text">PR #3 · frontend</text> |
| 44 | + </g> |
| 45 | + |
| 46 | + <line x1="190" y1="262" x2="190" y2="232" marker-end="url(#arrow)" class="arrow-line"/> |
| 47 | + <line x1="190" y1="188" x2="190" y2="158" marker-end="url(#arrow)" class="arrow-line"/> |
| 48 | + <line x1="190" y1="114" x2="190" y2="84" marker-end="url(#arrow)" class="arrow-line"/> |
| 49 | + |
| 50 | + <text x="320" y="210" dominant-baseline="central" class="annotation">← bottom</text> |
| 51 | + <text x="320" y="62" dominant-baseline="central" class="annotation">← top</text> |
| 52 | + </svg> |
| 53 | +</div> |
| 54 | + |
| 55 | +<style> |
| 56 | + .stack-diagram-wrapper { |
| 57 | + color: #1f1f1f; |
| 58 | + } |
| 59 | + :root[data-theme='dark'] .stack-diagram-wrapper { |
| 60 | + color: #ffffff; |
| 61 | + } |
| 62 | +</style> |
0 commit comments