mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-18 06:49:47 +02:00
#2088 Add the possibility to theme forks and joins using theme variables
This commit is contained in:
@@ -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>
|
||||||
|
@@ -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;
|
||||||
|
@@ -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;
|
||||||
|
@@ -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;
|
||||||
|
@@ -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;
|
||||||
|
Reference in New Issue
Block a user