mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-18 23:09:49 +02:00
#5237 Fix for issue with text-centering in state-diagrams with htmlLabels true and subgraph title bkg
This commit is contained in:
@@ -41,6 +41,9 @@ const getStyles = (options: FlowChartStyleOptions) =>
|
||||
.cluster-label span {
|
||||
color: ${options.titleColor};
|
||||
}
|
||||
.cluster-label span p {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.label text,span {
|
||||
fill: ${options.nodeTextColor || options.textColor};
|
||||
@@ -56,7 +59,7 @@ const getStyles = (options: FlowChartStyleOptions) =>
|
||||
stroke: ${options.nodeBorder};
|
||||
stroke-width: 1px;
|
||||
}
|
||||
.flowchart-label text {
|
||||
.node .label text {
|
||||
text-anchor: middle;
|
||||
}
|
||||
// .flowchart-label .text-outer-tspan {
|
||||
|
@@ -233,10 +233,7 @@ export const createText = async (
|
||||
structuredText,
|
||||
text ? addSvgBackground : false
|
||||
);
|
||||
svgLabel.setAttribute(
|
||||
'style',
|
||||
style.replace('fill:', 'color:') + (isNode ? ';text-anchor: middle;' : '')
|
||||
);
|
||||
svgLabel.setAttribute('style', style.replace('fill:', 'color:'));
|
||||
return svgLabel;
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user