Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mermaid entity relation diagram

Tags:

mermaid

I have read mermaid styling documentation section: https://mermaid-js.github.io/mermaid/#/entityRelationshipDiagram?id=styling

Now, I can't figure out how to apply any styles for the ER diagram.There are no any examples or general info about styling.

Does any body have any idea?

like image 968
Anton Semenov Avatar asked Oct 28 '25 14:10

Anton Semenov


1 Answers

I found the answer. The important part of the documentation is "Config options" section. this mean the styles should be placed accordinly. Mermaid config could be placed into mermaid.initialize() or inline on the first line of your digram with %%{init: { }}%% expression. You can see details here https://mermaid-js.github.io/mermaid/#/./directives.

example for ER diagram styling:

%%{init: {'themeCSS': '.er.attributeBoxEven { fill: #f2f2f2; }' }}%%
like image 189
Anton Semenov Avatar answered Oct 31 '25 13:10

Anton Semenov