mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-11-18 19:54:17 +01:00
fix: icon and text color mismatch for root node
on-behalf-of: @Mermaid-Chart <hello@mermaidchart.com>
This commit is contained in:
@@ -128,7 +128,7 @@ export async function insertMindmapIcon(
|
|||||||
}
|
}
|
||||||
|
|
||||||
const { iconSize, iconPadding, shapeType } = config;
|
const { iconSize, iconPadding, shapeType } = config;
|
||||||
const section = node.section ?? 0;
|
const section = node.section === undefined ? -1 : node.section;
|
||||||
|
|
||||||
let iconName = node.icon;
|
let iconName = node.icon;
|
||||||
const isCssFormat = iconName.includes(' ');
|
const isCssFormat = iconName.includes(' ');
|
||||||
@@ -171,6 +171,7 @@ export async function insertMindmapIcon(
|
|||||||
}
|
}
|
||||||
|
|
||||||
iconElem.attr('transform', `translate(${iconX}, ${iconY})`);
|
iconElem.attr('transform', `translate(${iconX}, ${iconY})`);
|
||||||
|
// Use currentColor to inherit label color - works for all shapes including bang
|
||||||
iconElem.attr('style', 'color: currentColor;');
|
iconElem.attr('style', 'color: currentColor;');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,6 +67,9 @@ const getStyles: DiagramStylesProvider = (options) =>
|
|||||||
.section-root span {
|
.section-root span {
|
||||||
color: ${options.gitBranchLabel0};
|
color: ${options.gitBranchLabel0};
|
||||||
}
|
}
|
||||||
|
.node-icon--1 {
|
||||||
|
color: ${options.gitBranchLabel0};
|
||||||
|
}
|
||||||
.section-2 span {
|
.section-2 span {
|
||||||
color: ${options.gitBranchLabel0};
|
color: ${options.gitBranchLabel0};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user