docs(flowchart): add section on styling arrow text labels#7770
docs(flowchart): add section on styling arrow text labels#7770Rafaelkocharli wants to merge 2 commits into
Conversation
✅ Deploy Preview for mermaid-js ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
@mermaid-js/examples
mermaid
@mermaid-js/layout-elk
@mermaid-js/layout-tidy-tree
@mermaid-js/mermaid-zenuml
@mermaid-js/parser
@mermaid-js/tiny
commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #7770 +/- ##
==========================================
- Coverage 3.26% 3.26% -0.01%
==========================================
Files 599 600 +1
Lines 60839 60850 +11
Branches 917 917
==========================================
Hits 1986 1986
- Misses 58853 58864 +11
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
Thanks @Rafaelkocharli for improving the documentation by this PR. A minor comment : [sisyphos-bot] What's working well 🎉 The new section is placed exactly where it belongs — directly after the existing "Styling links" subsection — so readers naturally discover it when they're already looking at 🎉 The three subsections progress in exactly the right order (global → by index → by edge ID), making the feature easy to discover at whatever level of specificity someone 🎉 The source file (packages/mermaid/src/docs/syntax/flowchart.md) is the one being edited, not just the generated /docs folder. ✓ 🎉 Resolves a well-structured documentation request (issue #7763) with clear, executable examples. Minor observation 🟢 [nit] The third example's classDef includes stroke:#f00,stroke-width:2px in addition to color:red: classDef redLabel color:red,stroke:#f00,stroke-width:2px Since this subsection is specifically about styling arrow text, the stroke and stroke-width properties (which style the edge line, not the label) are extra noise. A reader who classDef redLabel color:red The existing "Attaching an ID to edges" section already has a richer animation example if readers want to see more complete edge styling. Security No XSS or injection concerns. The three diagram examples use well-formed Mermaid syntax (linkStyle, classDef, class) with standard CSS color values. The classDef grammar |
📑 Summary
Add a new "Styling arrow text" subsection to the flowchart documentation, explaining how to change the color of edge label text using
linkStyle.Resolves #7763
📏 Design Decisions
The new section is placed directly after the existing "Styling links" subsection since it extends that topic. Three approaches are documented in order of increasing specificity:
linkStyle default color:red— applies to all arrow labels globallylinkStyle N color:blue— targets a specific link by its zero-based indexclassDef(v11.10.0+) — class-based styling for individual edges, useful in complex diagramsAll examples use
mermaid-exampleblocks so they render live in the docs.📋 Tasks