mermaidjs / mermaid.cli

Development has been moved to https://github.com/mermaid-js/mermaid-cli
MIT License
1.09k stars 117 forks source link

gantt charts - setting the font size in a mermaid json config file or a css file doesn't work #62

Closed rhz closed 1 year ago

rhz commented 5 years ago

Setting the font size in a mermaid json config file passed to mermaid.cli via its -c option doesn't change the font size in the output when generating gantt charts. The same happens when passing a css file using the -C option with the following content:

html { font-size: 14px; }

It seems the css imposed by the theme (even if you chose no theme) overrides the font size given in the json config file or the css file. The only workaround that I've found is to pass the following css instead

html { font: 14px/14px "Open-Sans" !important; }

The !important bit is key to make it work.

aloisklink commented 1 year ago

Development has moved to the https://github.com/mermaid-js/mermaid-cli repo, please re-open your issue there if it's still relevant. The package has also been renamed on NPM to @mermaid-js/mermaid-cli, so you may need to run npm uninstall mermaid.cli && npm install @mermaid-js/mermaid-cli to get the latest version of this package.

I believe in the mermaid config, you can set themeCSS to override this, but unfortunately it isn't documented anywhere, so I'm not really sure how it works, see https://github.com/mermaid-js/mermaid/blob/a3c645c3ebbe3017854b558ffc5a647fabaea587/packages/mermaid/src/config.type.ts#L66