mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-14 06:43:25 +08:00
gh-50 Allow styling of edge labels in css
This commit is contained in:
parent
9fb980ab2c
commit
52fcd18e6a
@ -192,7 +192,7 @@ exports.addEdges = function (edges, g) {
|
||||
var edgeText = edge.text.replace(/<br>/g, '\n');
|
||||
if(typeof edge.style === 'undefined'){
|
||||
if (conf.htmlLabels){
|
||||
g.setEdge(edge.start, edge.end,{labelType: 'html',style: style, labelpos:'c', label: '<span style="background:#e8e8e8">'+edge.text+'</span>', arrowheadStyle: 'fill: #333', arrowhead: aHead},cnt);
|
||||
g.setEdge(edge.start, edge.end,{labelType: 'html',style: style, labelpos:'c', label: '<span class="edgeLabel">'+edge.text+'</span>', arrowheadStyle: 'fill: #333', arrowhead: aHead},cnt);
|
||||
}else{
|
||||
g.setEdge(edge.start, edge.end,{labelType: 'text', style: 'stroke: #333; stroke-width: 1.5px;fill:none', labelpos:'c', label: edgeText, arrowheadStyle: 'fill: #333', arrowhead: aHead},cnt);
|
||||
}
|
||||
|
@ -11,8 +11,12 @@
|
||||
|
||||
.edgePath .path {
|
||||
stroke: @lineColor;
|
||||
|
||||
}
|
||||
|
||||
.edgeLabel {
|
||||
background-color: @edgeLabelBackground;
|
||||
}
|
||||
|
||||
.cluster rect{
|
||||
fill: @secondBkg !important;
|
||||
rx:4 !important;
|
||||
|
@ -15,6 +15,8 @@
|
||||
|
||||
@titleColor: #333;
|
||||
|
||||
@edgeLabelBackground: #e8e8e8;
|
||||
|
||||
/* Sequence Diagram variables */
|
||||
@actorBorder: @border1;
|
||||
@actorBkg: @mainBkg;
|
||||
|
@ -15,8 +15,12 @@ color:#333
|
||||
.edgePath .path {
|
||||
stroke: @lineColor;
|
||||
stroke-width: 1.5px;
|
||||
|
||||
}
|
||||
|
||||
.edgeLabel {
|
||||
background-color: @edgeLabelBackground;
|
||||
}
|
||||
|
||||
.cluster rect{
|
||||
fill: @secondBkg !important;
|
||||
rx:4 !important;
|
||||
|
@ -16,6 +16,8 @@
|
||||
|
||||
@titleColor: #333;
|
||||
|
||||
@edgeLabelBackground: #e8e8e8;
|
||||
|
||||
/* Sequence Diagram variables */
|
||||
@actorBorder: @border1;
|
||||
@actorBkg: @mainBkg;
|
||||
|
Loading…
x
Reference in New Issue
Block a user