How to allow font awesome icons in mermaid diagrams? #5140
-
Mermaid diagrams say that it supports font awesome icons: https://mermaid.js.org/syntax/flowchart.html#basic-support-for-fontawesome However you can see that when copy-pasting their code into material, the icons disappear exactly like in #1698 The docs for mermaid do note that they only support versions 4 and 5 of font-awesome, while material uses 6.3.0 as of 2023-03-03, so it seems likely it's just a version mismatch. Does anyone know of a way to add versions 4 and 5 of font-awesome so mermaid can use this? I am not a web dev and know almost nothing about javascript so any help would be appreciated ❤️ |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
You would need to integrate FontAwesome yourself, since Material for MkDocs doen't use icon fonts since version 5 – only SVGs – as this allows for custom icons and deeper integration in general. It should be possible to use the v4 or v5 FontAwesome icon font along side our bundled v6 icons, since those are two entirely different methods of embedding. Thus, I think adding the FontAwesome CSS via additional CSS should be sufficient. |
Beta Was this translation helpful? Give feedback.
-
I was playing around with this. I downloaded the v5 fontawesome assets: https://fontawesome.com/v5/download I put this into my mkdocs project and pointed the The way this gets rendered in HTML is:
I would insert the exact same icon in my mermaid diagram using their syntax. The HTML would get rendered as:
You can see it adding the exact same I wasn't sure how to proceed after this. Someone can maybe help push this along from where I left off. |
Beta Was this translation helpful? Give feedback.
You would need to integrate FontAwesome yourself, since Material for MkDocs doen't use icon fonts since version 5 – only SVGs – as this allows for custom icons and deeper integration in general.
It should be possible to use the v4 or v5 FontAwesome icon font along side our bundled v6 icons, since those are two entirely different methods of embedding. Thus, I think adding the FontAwesome CSS via additional CSS should be sufficient.