fix: icon and text color mismatch for root node

on-behalf-of: @Mermaid-Chart <hello@mermaidchart.com>
This commit is contained in:
darshanr0107
2025-11-06 15:41:16 +05:30
parent 998be0a3ce
commit 1874acfdb4
2 changed files with 5 additions and 1 deletions

View File

@@ -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;
} }

View File

@@ -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};
} }