|
1 | 1 | /* Don't panic, Mermaid scopes all styles to the parent SVG ID */
|
2 | 2 |
|
3 | 3 | * {
|
4 |
| - --font-family: Roboto, 'Helvetica Neue', HelveticaNeue, Helvetica, Arial, |
5 |
| - sans-serif; |
6 |
| - --font-size: 14px; |
| 4 | + /* https://github.com/mermaid-js/mermaid/blob/v10.1.0/packages/mermaid/src/diagrams/gantt/styles.js#L3-L6 */ |
| 5 | + --mermaid-font-family: Roboto, 'Helvetica Neue', HelveticaNeue, Helvetica, |
| 6 | + Arial, sans-serif; |
| 7 | + --mermaid-font-size: 14px; |
7 | 8 |
|
8 | 9 | /* https://github.com/mermaid-js/mermaid/blob/8.11.5/src/diagrams/er/erRenderer.js#L405-L406 */
|
9 | 10 | --mermaid-er-label-fill: rgba(255, 255, 255, 0.85);
|
10 | 11 |
|
11 | 12 | /* https://github.com/seek-oss/braid-design-system/blob/v31.14.0/lib/color/palette.ts */
|
| 13 | + --braid-blue-100: #e3f2fb; |
| 14 | + --braid-blue-300: #98c9f1; |
| 15 | + --braid-blue-700: #1d559d; |
12 | 16 | --braid-grey-50: #f7f8fb;
|
13 | 17 | --braid-grey-100: #eaecf1;
|
14 | 18 | --braid-grey-300: #abb3c1;
|
15 | 19 | --braid-grey-500: #5a6881;
|
| 20 | + --braid-mint-100: #e2f7f1; |
| 21 | + --braid-mint-300: #8bdec5; |
| 22 | + --braid-mint-700: #12784f; |
| 23 | + --braid-red-300: #fb999a; |
| 24 | + --braid-red-700: #b91e1e; |
16 | 25 | --braid-yellow-100: #fef8de;
|
17 | 26 | --braid-yellow-500: #fdc221;
|
18 | 27 | }
|
|
21 | 30 |
|
22 | 31 | body,
|
23 | 32 | text {
|
24 |
| - font-family: var(--font-family); |
25 |
| - font-size: var(--font-size); |
| 33 | + font-family: var(--mermaid-font-family); |
| 34 | + font-size: var(--mermaid-font-size); |
26 | 35 | }
|
27 | 36 |
|
28 | 37 | /* er */
|
@@ -59,8 +68,8 @@ g.edgeLabel span.edgeLabel,
|
59 | 68 | g.label div,
|
60 | 69 | g.node div,
|
61 | 70 | g.node span.nodeLabel {
|
62 |
| - font-family: var(--font-family); |
63 |
| - font-size: var(--font-size); |
| 71 | + font-family: var(--mermaid-font-family); |
| 72 | + font-size: var(--mermaid-font-size); |
64 | 73 | }
|
65 | 74 |
|
66 | 75 | g.node foreignObject.label {
|
@@ -104,12 +113,102 @@ path.arrowMarkerPath {
|
104 | 113 | fill: var(--braid-grey-500);
|
105 | 114 | }
|
106 | 115 |
|
| 116 | +/* gantt */ |
| 117 | + |
| 118 | +g.grid > g.tick > path, |
| 119 | +rect.task { |
| 120 | + stroke-width: 1px; |
| 121 | +} |
| 122 | + |
| 123 | +g.grid > g.tick > path { |
| 124 | + color: var(--braid-grey-100); |
| 125 | + shape-rendering: crispEdges; |
| 126 | +} |
| 127 | + |
| 128 | +g.grid > g.tick > text, |
| 129 | +text.sectionTitle { |
| 130 | + fill: var(--braid-grey-500); |
| 131 | +} |
| 132 | + |
| 133 | +path.section0, |
| 134 | +path.section1 { |
| 135 | + fill: none; |
| 136 | +} |
| 137 | + |
| 138 | +rect.task.active0 { |
| 139 | + fill: var(--braid-grey-50); |
| 140 | + stroke: var(--braid-grey-300); |
| 141 | +} |
| 142 | + |
| 143 | +rect.task.active1 { |
| 144 | + fill: var(--braid-blue-100); |
| 145 | + stroke: var(--braid-blue-300); |
| 146 | +} |
| 147 | + |
| 148 | +rect.task.done0, |
| 149 | +rect.task.done1 { |
| 150 | + fill: var(--braid-mint-100); |
| 151 | + stroke: var(--braid-mint-300); |
| 152 | +} |
| 153 | + |
| 154 | +rect.task.milestone { |
| 155 | + fill: var(--braid-blue-700); |
| 156 | + stroke: var(--braid-blue-300); |
| 157 | +} |
| 158 | + |
| 159 | +rect.task.milestone.crit0, |
| 160 | +rect.task.milestone.crit1 { |
| 161 | + fill: var(--braid-red-700); |
| 162 | + stroke: var(--braid-red-300); |
| 163 | +} |
| 164 | + |
| 165 | +rect.task.milestone.done0, |
| 166 | +rect.task.milestone.done1 { |
| 167 | + fill: var(--braid-mint-700); |
| 168 | + stroke: var(--braid-mint-300); |
| 169 | +} |
| 170 | + |
| 171 | +text.sectionTitle { |
| 172 | + /* https://github.com/mermaid-js/mermaid/blob/v10.1.0/packages/mermaid/src/diagrams/gantt/ganttRenderer.js#L671 */ |
| 173 | + transform: translateX(-10px); |
| 174 | +} |
| 175 | + |
| 176 | +text.taskText.activeText0, |
| 177 | +text.taskTextOutside0.activeText0, |
| 178 | +text.taskTextOutside1.activeText0 { |
| 179 | + fill: var(--braid-grey-500) !important; |
| 180 | +} |
| 181 | + |
| 182 | +text.taskText.activeText1, |
| 183 | +text.taskTextOutside0.activeText1, |
| 184 | +text.taskTextOutside1.activeText1, |
| 185 | +text.taskTextOutside0.milestoneText, |
| 186 | +text.taskTextOutside1.milestoneText { |
| 187 | + fill: var(--braid-blue-700) !important; |
| 188 | +} |
| 189 | + |
| 190 | +text.taskText.doneText0, |
| 191 | +text.taskText.doneText1, |
| 192 | +text.taskTextOutside0.doneText0, |
| 193 | +text.taskTextOutside0.doneText1, |
| 194 | +text.taskTextOutside1.doneText0, |
| 195 | +text.taskTextOutside1.doneText1 { |
| 196 | + fill: var(--braid-mint-700) !important; |
| 197 | +} |
| 198 | + |
| 199 | +text.taskTextOutside0.milestoneText.critText0, |
| 200 | +text.taskTextOutside0.milestoneText.critText1, |
| 201 | +text.taskTextOutside1.milestoneText.critText0, |
| 202 | +text.taskTextOutside1.milestoneText.critText1 { |
| 203 | + fill: var(--braid-red-700) !important; |
| 204 | +} |
| 205 | + |
107 | 206 | /* sequence */
|
108 | 207 |
|
109 | 208 | text.actor,
|
110 | 209 | text.messageText {
|
111 |
| - font-family: var(--font-family); |
112 |
| - font-size: var(--font-size); |
| 210 | + font-family: var(--mermaid-font-family); |
| 211 | + font-size: var(--mermaid-font-size); |
113 | 212 | stroke: none;
|
114 | 213 | text-anchor: middle;
|
115 | 214 | }
|
|
0 commit comments