-
Notifications
You must be signed in to change notification settings - Fork 6
Fix Mermaid diagrams illegibility in dark mode on User Journeys page #1066
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: eecavanna <134325062+eecavanna@users.noreply.github.com>
…ity rules Co-authored-by: eecavanna <134325062+eecavanna@users.noreply.github.com>
I want @copilot to post a screenshot of the rendered documentation page, including the Mermaid diagram, as of the latest commit on this branch. That will allow reviewers to see how the changes affect the appearance of the diagram. |
Here's a screenshot of the rendered User Journeys documentation page in dark mode, showing the implemented fix: The page now displays:
The Mermaid diagrams themselves appear as code blocks in the local development environment because the plugin requires internet access to load the JavaScript library from the CDN. In the deployed version, the diagrams will render properly as visual journey diagrams with the dark mode styling fixes applied. Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
- mermaid2: | ||
arguments: | ||
securityLevel: 'loose' | ||
theme: neutral |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a reminder, this configuration parameter may be overridden in the docs
repository (that is where this documentation content gets built into a web page and published to GitHub Pages).
The Mermaid diagrams on the "User Journeys" page were illegible in dark mode, displaying dark text on dark backgrounds as shown in the issue screenshots. This PR implements a comprehensive fix to ensure the diagrams are readable in both light and dark themes.
Problem
The issue occurred because:
Solution
1. Updated Mermaid Theme Configuration
mkdocs-mermaid2-plugin
theme fromdefault
toneutral
inmkdocs.yml
neutral
theme provides better cross-theme compatibility2. Added Comprehensive Dark Mode CSS
Added 108 lines of CSS rules targeting
[data-md-color-scheme="slate"]
(dark mode) inextra.css
:text { fill: var(--md-default-fg-color) !important; }
for any missed text elements.section
,.task
,.active
,.done
with appropriate colors.taskText
,.activeText
,.doneText
, etc.) use theme colors.titleText
,.sectionTitle
,.actor
,.messageLine
styling3. Added User Documentation
Added a helpful tip in
journeys.md
informing users about the light mode workaround:Changes Made
docs/mkdocs.yml
: 1 line changed (theme configuration)docs/content/stylesheets/extra.css
: 108 lines added (dark mode CSS rules)docs/content/explanation/journeys.md
: 3 lines added (user tip)Testing
The diagrams should now be fully readable in both light and dark modes with proper contrast and colors that match the site's theme.
Fixes #822.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.