Github mermaid rendering is still broken in dark mode #194348
Replies: 2 comments
-
|
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
Beta Was this translation helpful? Give feedback.
-
|
Hi @echlebek! Can confirm this is a known issue — Mermaid on GitHub reads the theme at render time but doesn't correctly detect the Workaround while GitHub fixes this: You can force Mermaid to use a dark-compatible theme directly in your diagram using the This makes the diagram render with the dark theme regardless of what GitHub detects from the OS, so it looks correct for everyone in dark mode. The downside is it will always use dark theme even for light mode users, so it's a trade-off. A better long-term workaround would be to use The root cause is that GitHub's Mermaid integration doesn't re-render diagrams when |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
🏷️ Discussion Type
Bug
💬 Feature/Topic Area
UX/UI
Body
Previous discussion, which indicates unresolved issues, but maintainer asking for new issue to be filed: https://github.com/orgs/community/discussions/35733
While Github mermaid rendering now works when the theme is explicitly set to dark mode, it is still broken when dark mode is implied by system setting.
Given this mermaid source:
sequenceDiagram box transparent Reconciliation on Resource Event participant client as k8s-client participant api as api-server participant cr@{ "type": "control" } as controller-runtime end client->>api: spec subresource update api-->>client: ok api->>cr: resource event loop reconciler cr->>cr: compute status, can retry end cr->>api: status subresource apply api-->>cr: okIt renders like this when the theme is set to system, and the system theme is dark mode: (MacOS Tahoe, Chrome 147)
Has been reproduced by a colleague also on Mac OS Tahoe and Chrome.
Other than attempting to exert very fine grained control over the diagram styling, there doesn't appear to be anything I can do to fix this as a user, unless I want to disable the sync with system mode.
Beta Was this translation helpful? Give feedback.
All reactions