Skip to content

Allow classDef for linkStyle in flowchart :::style syntax #136

Open
@stefan123t

Description

@stefan123t

Is your feature request related to a problem? Please describe.
Currently styling links is not possible using classDef but only linkStyle in flowchart mermaid.

Describe the solution you'd like
Allow styling of flowchart links using the same syntax as with nodes

flowchart LR

  node1:::style1
  node2:::style2
  node3:::style3
  node1 —> node2
  node2 —>:::style3 node3
  %% alternative syntax for named links
  node3 —namedlink:::style3–> node1

  classDef style1 fill:#f00;
  classDef style2 fill:#0f0;

  linkStyle 1 color:blue;
  classDef style3 fill:#00f;
flowchart LR

  node1:::style1
  node2:::style2
  node3:::style3
  node1 —> node2

  node2 —>:::style3 node3
  %% alternative syntax for named links
  node3 —namedlink:::style3–> node1

  classDef style1 fill:#f00;
  classDef style2 fill:#0f0;

  linkStyle 1 color:blue;
  classDef style3 fill:#00f;
Loading

Describe alternatives you've considered
The alternative syntax for styling named links would inline the style information into the link.
Maybe this is preferable for clarity?

Additional context
https://mermaid.js.org/syntax/flowchart.html#styling-links

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions