mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-25 10:20:06 +02:00
Add 'neo-line' class to divider lines when appropriate
This commit is contained in:
@@ -12,6 +12,9 @@ import type { D3Selection } from '../../../types.js';
|
|||||||
|
|
||||||
export async function classBox<T extends SVGGraphicsElement>(parent: D3Selection<T>, node: Node) {
|
export async function classBox<T extends SVGGraphicsElement>(parent: D3Selection<T>, node: Node) {
|
||||||
const config = getConfig();
|
const config = getConfig();
|
||||||
|
const { themeVariables } = config;
|
||||||
|
const { useGradient } = themeVariables;
|
||||||
|
|
||||||
const PADDING = config.class!.padding ?? 12;
|
const PADDING = config.class!.padding ?? 12;
|
||||||
const GAP = PADDING;
|
const GAP = PADDING;
|
||||||
const useHtmlLabels = node.useHtmlLabels ?? evaluate(config.htmlLabels) ?? true;
|
const useHtmlLabels = node.useHtmlLabels ?? evaluate(config.htmlLabels) ?? true;
|
||||||
@@ -199,7 +202,9 @@ export async function classBox<T extends SVGGraphicsElement>(parent: D3Selection
|
|||||||
options
|
options
|
||||||
);
|
);
|
||||||
const line = shapeSvg.insert(() => roughLine);
|
const line = shapeSvg.insert(() => roughLine);
|
||||||
line.attr('class', 'divider').attr('style', styles);
|
line
|
||||||
|
.attr('class', `divider${node.look === 'neo' && !useGradient ? ' neo-line' : ''}`)
|
||||||
|
.attr('style', styles);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Second line (under members)
|
// Second line (under members)
|
||||||
@@ -214,7 +219,9 @@ export async function classBox<T extends SVGGraphicsElement>(parent: D3Selection
|
|||||||
options
|
options
|
||||||
);
|
);
|
||||||
const line = shapeSvg.insert(() => roughLine);
|
const line = shapeSvg.insert(() => roughLine);
|
||||||
line.attr('class', 'divider').attr('style', styles);
|
line
|
||||||
|
.attr('class', `divider${node.look === 'neo' && !useGradient ? ' neo-line' : ''}`)
|
||||||
|
.attr('style', styles);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Apply styles ///
|
/// Apply styles ///
|
||||||
|
Reference in New Issue
Block a user