From 7566b5620eadffa383410fe8bfa3429ab14db2e6 Mon Sep 17 00:00:00 2001 From: Alois Klink Date: Thu, 13 Apr 2023 06:09:41 +0100 Subject: [PATCH] fix: fix `requirementBorderSize` theme variable Currently, `requirementBorderSize` defaults to `primaryBorderColor`, which is a color, not a valid SVG `stroke-width`. Instead, I've made it default to `1`. --- packages/mermaid/src/themes/theme-base.js | 2 +- packages/mermaid/src/themes/theme-dark.js | 2 +- packages/mermaid/src/themes/theme-default.js | 2 +- packages/mermaid/src/themes/theme-forest.js | 2 +- packages/mermaid/src/themes/theme-neutral.js | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/mermaid/src/themes/theme-base.js b/packages/mermaid/src/themes/theme-base.js index 01f8a9c0b..a3d4a738f 100644 --- a/packages/mermaid/src/themes/theme-base.js +++ b/packages/mermaid/src/themes/theme-base.js @@ -219,7 +219,7 @@ class Theme { /* requirement-diagram */ this.requirementBackground = this.requirementBackground || this.primaryColor; this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor; - this.requirementBorderSize = this.requirementBorderSize || this.primaryBorderColor; + this.requirementBorderSize = this.requirementBorderSize || '1'; this.requirementTextColor = this.requirementTextColor || this.primaryTextColor; this.relationColor = this.relationColor || this.lineColor; this.relationLabelBackground = diff --git a/packages/mermaid/src/themes/theme-dark.js b/packages/mermaid/src/themes/theme-dark.js index 6ee26169d..8fde494bd 100644 --- a/packages/mermaid/src/themes/theme-dark.js +++ b/packages/mermaid/src/themes/theme-dark.js @@ -231,7 +231,7 @@ class Theme { /* requirement-diagram */ this.requirementBackground = this.requirementBackground || this.primaryColor; this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor; - this.requirementBorderSize = this.requirementBorderSize || this.primaryBorderColor; + this.requirementBorderSize = this.requirementBorderSize || '1'; this.requirementTextColor = this.requirementTextColor || this.primaryTextColor; this.relationColor = this.relationColor || this.lineColor; this.relationLabelBackground = diff --git a/packages/mermaid/src/themes/theme-default.js b/packages/mermaid/src/themes/theme-default.js index 339bfa48a..460a1b920 100644 --- a/packages/mermaid/src/themes/theme-default.js +++ b/packages/mermaid/src/themes/theme-default.js @@ -250,7 +250,7 @@ class Theme { /* requirement-diagram */ this.requirementBackground = this.requirementBackground || this.primaryColor; this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor; - this.requirementBorderSize = this.requirementBorderSize || this.primaryBorderColor; + this.requirementBorderSize = this.requirementBorderSize || '1'; this.requirementTextColor = this.requirementTextColor || this.primaryTextColor; this.relationColor = this.relationColor || this.lineColor; this.relationLabelBackground = this.relationLabelBackground || this.labelBackground; diff --git a/packages/mermaid/src/themes/theme-forest.js b/packages/mermaid/src/themes/theme-forest.js index 3d47684bc..527c6a38c 100644 --- a/packages/mermaid/src/themes/theme-forest.js +++ b/packages/mermaid/src/themes/theme-forest.js @@ -219,7 +219,7 @@ class Theme { /* requirement-diagram */ this.requirementBackground = this.requirementBackground || this.primaryColor; this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor; - this.requirementBorderSize = this.requirementBorderSize || this.primaryBorderColor; + this.requirementBorderSize = this.requirementBorderSize || '1'; this.requirementTextColor = this.requirementTextColor || this.primaryTextColor; this.relationColor = this.relationColor || this.lineColor; this.relationLabelBackground = this.relationLabelBackground || this.edgeLabelBackground; diff --git a/packages/mermaid/src/themes/theme-neutral.js b/packages/mermaid/src/themes/theme-neutral.js index 9dce63b8d..15c3d1d2d 100644 --- a/packages/mermaid/src/themes/theme-neutral.js +++ b/packages/mermaid/src/themes/theme-neutral.js @@ -249,7 +249,7 @@ class Theme { /* requirement-diagram */ this.requirementBackground = this.requirementBackground || this.primaryColor; this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor; - this.requirementBorderSize = this.requirementBorderSize || this.primaryBorderColor; + this.requirementBorderSize = this.requirementBorderSize || '1'; this.requirementTextColor = this.requirementTextColor || this.primaryTextColor; this.relationColor = this.relationColor || this.lineColor; this.relationLabelBackground = this.relationLabelBackground || this.edgeLabelBackground;