From 81c2f0f7a9374307e7155573bea5cef17b33c728 Mon Sep 17 00:00:00 2001 From: yari-dewalt Date: Fri, 22 Nov 2024 08:29:52 -0800 Subject: [PATCH] Add 'neo-line' class to divider lines when appropriate --- .../rendering-elements/shapes/classBox.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/mermaid/src/rendering-util/rendering-elements/shapes/classBox.ts b/packages/mermaid/src/rendering-util/rendering-elements/shapes/classBox.ts index 01e5d1e37..fc6509c09 100644 --- a/packages/mermaid/src/rendering-util/rendering-elements/shapes/classBox.ts +++ b/packages/mermaid/src/rendering-util/rendering-elements/shapes/classBox.ts @@ -12,6 +12,9 @@ import type { D3Selection } from '../../../types.js'; export async function classBox(parent: D3Selection, node: Node) { const config = getConfig(); + const { themeVariables } = config; + const { useGradient } = themeVariables; + const PADDING = config.class!.padding ?? 12; const GAP = PADDING; const useHtmlLabels = node.useHtmlLabels ?? evaluate(config.htmlLabels) ?? true; @@ -199,7 +202,9 @@ export async function classBox(parent: D3Selection options ); 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) @@ -214,7 +219,9 @@ export async function classBox(parent: D3Selection options ); 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 ///