How to style a Mermaid subgraph's title?

Viewed 985

How to style the title in a Mermaid subgraph? I would like to make the font larger and add some blank space between the title and the first node beneath it.

I tried adding some <br/>'s after the title but that pushed the title above the boundary of the subgraph.

graph TB

subgraph someID[Some Title]
    direction TB
    ....
end 
2 Answers

If you are looking for styling that do not include coloring, you may try something like this:

someID:::someClass

subgraph someID[Some Title]
    someItem(The subgraph title has some style)
end 

classdef someClass padding-left:5em;

Reference: Mermaid classes

Unfortunately, there is no possibility to style the title at the moment (see this pull request).

Note that given how subgraph SVG tags are built up, there is no (current) way to style the title text.

Related