Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
stefan123t opened this issue Feb 26, 2025 · 0 comments
Open

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

stefan123t opened this issue Feb 26, 2025 · 0 comments

Comments

@stefan123t
Copy link

stefan123t commented Feb 26, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant