Make Pulumi Mermaid theme a portable module with full diagram coverage#19904
Make Pulumi Mermaid theme a portable module with full diagram coverage#19904jeffmerrick wants to merge 2 commits into
Conversation
Move the inline Mermaid script out of head.html into a dedicated mermaid.html partial, add light/dark Pulumi-brand theming driven by the docs data-theme, and reset the global content `p` styles that bled into diagram labels. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Extract the Pulumi-brand Mermaid theme into a dependency-free module (static/js/pulumi-mermaid-theme.js) that can be dropped into other codebases. Expand coverage to all Mermaid v11 diagram types (git, journey, timeline, xychart, radar, treemap, ER, kanban, packet, etc.), resolve each diagram's theme from the nearest data-theme ancestor, render in theme-grouped sequential batches, and fix flex-based centering that broke container-width measurement. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Pre-merge Review — Last updated 2026-06-26T18:09:56ZTip Summary: This is an infrastructure refactor that extracts the inline Mermaid renderer from Review confidence:
Investigation log
🔍 Verification trail3 claims extracted · 3 verified · 0 unverifiable · 0 contradicted
🚨 Outstanding in this PRNo outstanding findings in this PR.
|
|
Your site preview for commit 9d81641 is ready! 🎉 http://www-testing-pulumi-docs-origin-pr-19904-9d816418.s3-website.us-west-2.amazonaws.com |
Lighthouse Performance ReportCommit: 9d81641 | Metric definitions
|
CamSoper
left a comment
There was a problem hiding this comment.
This looks great! Someone was just asking me the other day about our Mermaid support.
Updates to the mermaid theme for most diagrams/charts (a couple minor ones aren't possible to style, but we aren't using them anyhow).
Next up is to add the theme to the brand guidelines and into the slidev theme.
Proposed changes
Extracts the Mermaid renderer out of
head.htmlinto a dedicatedmermaid.htmlpartial (loaded lazily, only on pages with diagrams) and moves the Pulumi-brand theme into a portable, dependency-free module (static/js/pulumi-mermaid-theme.js) that can be dropped into other codebases, slide decks, or notebooks. The theme is expanded from flowchart/sequence coverage to all Mermaid v11 diagram types (git, journey, timeline, xychart, radar, treemap, ER, kanban, packet, mindmap, etc.), with every color sourced from a Pulumi brand token. Each diagram now resolves its light/dark theme from the nearestdata-themeancestor and diagrams render in theme-grouped sequential batches to avoid Mermaid's shared-state races. Also fixes flex-based centering in_code.scssthat broke Mermaid's container-width measurement (notably gantt) and stops global contentpstyling from bleeding into diagram labels.