Skip to content

Conversation

@Octavi00
Copy link

@Octavi00 Octavi00 commented Dec 5, 2025

Co-authored-by: Hien T Ly hien.ly@sjsu.edu
Co-authored-by: Jaime Serrano Acevedo xilverscott@gmail.com

Resolves -> Adding Mermaid Diagram Support #168

Changes

  • Installed astro-mermaid package for diagram rendering.
  • Inside src/content/contributor-docs/en/webgl_mode_architecture.mdx, the Mermaid diagram didn’t need to be modified after the install.
  • In astro.config.mjs, imported mermaid from astro mermaid. Added mermaid in the integrations section, with autotheme as an option.

Notes:

  • package.json was modified by the installation of astro-mermaid.
  • Mermaid installation was also successfully tested for rendering other diagrams, apart from class diagrams, within the /workspaces/groupE-mermaid-p5.js-website/src/content/contributor-docs/en/webgl_mode_architecture.mdx file.

Screenshots of the diagram below

--- Before the changes ---
diagram_before

In git hub:
github_diagram_before

--- After the fix ---
diagram_after

Mermaid diagram in dark mode:
diagram_after_darkmode

In git gub:
github_diagram_postfix

H13NL and others added 25 commits November 13, 2025 04:23
…size but rather h4<small>, because git doesnt recognize font size either
Uploading Hien's branch to Main fork branch (NOT OFFICIAL PR)
Pushing Hien Branch onto main #2
This reverts commit 1b67d8f, reversing
changes made to 4b9274c.
… for dark—because Mermaid diagrams are rendered at build time and can’t switch themes dynamically. Each version is wrapped in its own container using a html script, and CSS rules in global.scss hide or show the appropriate diagram depending on whether the .dark-theme class is active. This ensures users always see a diagram that matches their current theme
@ksen0
Copy link
Member

ksen0 commented Dec 5, 2025

Thank you for your work on this!

The dark mode not showing up I think is not a major blocker; this can be a follow up issue.

Alternatively, if you have capacity to investigate further, you could see if it's possible to add an invert filter? Either as a style filter:invert(100%) as I checked below:

screenshot of the diagram with colors inverted in dark mode using chrome inspector

Or, preferably, using the invert-in-dark class which is intended for this use:

.dark-theme .invert-in-dark {

cc @davepagurek

@H13NL
Copy link

H13NL commented Dec 6, 2025

Hi @ksen0, thanks for your reply.
I was able to add invert filter for the diagrams by adding a few line in global.scss.
I tested with some other type of diagrams and it seem to be working.
Screenshot 2025-12-06 002749

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants