Can I inherit classes in mermaid?

To display internal links in diagrams, the node must be assigned the internal-link class.
I want to make my class so that there is a single display of multiple nodes and keep the internal links working.
Can I somehow inherit my class from internal links? Or is there another way to solve the problem?

I don’t know about inheritance, but you can give nodes multiple classes. Here A has the green-fill class, B has the red-stroke class, and C has both:

graph LR
A --> B --> C
classDef greenfill fill:#dfd
classDef redstroke stroke:#f00
class A greenfill
class B redstroke
class C greenfill
class C redstroke

image

Hope this helps!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.