#2088 Add the possibility to theme forks and joins using theme variables

This commit is contained in:
Knut Sveidqvist
2021-05-23 10:42:07 +02:00
parent 529824e2b3
commit bf21aa8cd6
5 changed files with 10 additions and 8 deletions

View File

@@ -10,7 +10,7 @@
<style> <style>
body { body {
/* background: rgb(221, 208, 208); */ /* background: rgb(221, 208, 208); */
background:#333; /* background:#333; */
font-family: 'Arial'; font-family: 'Arial';
/* font-size: 18px !important; */ /* font-size: 18px !important; */
} }
@@ -66,14 +66,16 @@ stateDiagram-v2
</div> </div>
<div class="mermaid" style="width: 100%; height: 20%;"> <div class="mermaid" style="width: 100%; height: 20%;">
%%{init:{"theme":"neutral", "themeVariables": { %%{init:{"theme":"forest", "themeVariables": {
"specialStateColor":"red", "innerEndBackground":"lightgreen"
}}}%% }}}%%
%% "specialStateColor":"red", "innerEndBackground":"lightgreen"
stateDiagram-v2 stateDiagram-v2
state fork [[fork]] state fork [[fork]]
state join [[join]] state join [[join]]
[*] --> fork [*] --> fork
fork --> join fork --> Test
Test --> join
join --> [*] join --> [*]
</div> </div>
<script src="./mermaid.js"></script> <script src="./mermaid.js"></script>

View File

@@ -121,7 +121,7 @@ class Theme {
this.altBackground = this.altBackground || this.tertiaryColor; this.altBackground = this.altBackground || this.tertiaryColor;
this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg; this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg;
this.compositeBorder = this.compositeBorder || this.nodeBorder; this.compositeBorder = this.compositeBorder || this.nodeBorder;
this.innerEndBackground = this.primaryBorderColor; this.innerEndBackground = this.nodeBorder;
this.errorBkgColor = this.errorBkgColor || this.tertiaryColor; this.errorBkgColor = this.errorBkgColor || this.tertiaryColor;
this.errorTextColor = this.errorTextColor || this.tertiaryTextColor; this.errorTextColor = this.errorTextColor || this.tertiaryTextColor;
this.transitionColor = this.transitionColor || this.lineColor; this.transitionColor = this.transitionColor || this.lineColor;

View File

@@ -137,7 +137,7 @@ class Theme {
this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg; this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg;
this.compositeBorder = this.compositeBorder || this.nodeBorder; this.compositeBorder = this.compositeBorder || this.nodeBorder;
this.innerEndBackground = this.primaryBorderColor; this.innerEndBackground = this.primaryBorderColor;
this.specialStateColor = this.lineColor; this.specialStateColor = '#f4f4f4'; // this.lineColor;
this.errorBkgColor = this.errorBkgColor || this.tertiaryColor; this.errorBkgColor = this.errorBkgColor || this.tertiaryColor;
this.errorTextColor = this.errorTextColor || this.tertiaryTextColor; this.errorTextColor = this.errorTextColor || this.tertiaryTextColor;

View File

@@ -149,7 +149,7 @@ class Theme {
this.altBackground = this.altBackground || '#f0f0f0'; this.altBackground = this.altBackground || '#f0f0f0';
this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg; this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg;
this.compositeBorder = this.compositeBorder || this.nodeBorder; this.compositeBorder = this.compositeBorder || this.nodeBorder;
this.innerEndBackground = this.primaryBorderColor; this.innerEndBackground = this.nodeBorder;
this.specialStateColor = this.lineColor; this.specialStateColor = this.lineColor;
this.errorBkgColor = this.errorBkgColor || this.tertiaryColor; this.errorBkgColor = this.errorBkgColor || this.tertiaryColor;

View File

@@ -157,7 +157,7 @@ class Theme {
this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg; this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg;
this.stateBorder = this.stateBorder || '#000'; this.stateBorder = this.stateBorder || '#000';
this.innerEndBackground = this.primaryBorderColor; this.innerEndBackground = this.primaryBorderColor;
this.specialStateColor = this.lineColor; this.specialStateColor = '#222';
this.errorBkgColor = this.errorBkgColor || this.tertiaryColor; this.errorBkgColor = this.errorBkgColor || this.tertiaryColor;
this.errorTextColor = this.errorTextColor || this.tertiaryTextColor; this.errorTextColor = this.errorTextColor || this.tertiaryTextColor;