mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-23 17:29:54 +02:00
#1542 Dark theme fixes for pie and user-journey
This commit is contained in:
@@ -7,8 +7,11 @@ const getStyles = options =>
|
|||||||
}
|
}
|
||||||
.slice {
|
.slice {
|
||||||
font-family: ${options.fontFamily};
|
font-family: ${options.fontFamily};
|
||||||
|
fill: ${options.textColor};
|
||||||
|
// fill: white;
|
||||||
}
|
}
|
||||||
.legend text {
|
.legend text {
|
||||||
|
fill: ${options.taskTextDarkColor};
|
||||||
font-family: ${options.fontFamily};
|
font-family: ${options.fontFamily};
|
||||||
font-size: 17px;
|
font-size: 17px;
|
||||||
}
|
}
|
||||||
|
@@ -2,13 +2,29 @@ const getStyles = options =>
|
|||||||
`.label {
|
`.label {
|
||||||
font-family: 'trebuchet ms', verdana, arial;
|
font-family: 'trebuchet ms', verdana, arial;
|
||||||
font-family: var(--mermaid-font-family);
|
font-family: var(--mermaid-font-family);
|
||||||
color: #333;
|
color: ${options.textColor};
|
||||||
|
}
|
||||||
|
.mouth {
|
||||||
|
stroke: #666;
|
||||||
|
}
|
||||||
|
|
||||||
|
line {
|
||||||
|
stroke: ${options.textColor}
|
||||||
|
}
|
||||||
|
|
||||||
|
.legend {
|
||||||
|
fill: ${options.textColor};
|
||||||
}
|
}
|
||||||
|
|
||||||
.label text {
|
.label text {
|
||||||
fill: #333;
|
fill: #333;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.face {
|
||||||
|
fill: #FFF8DC;
|
||||||
|
stroke: #999';
|
||||||
|
}
|
||||||
|
|
||||||
.node rect,
|
.node rect,
|
||||||
.node circle,
|
.node circle,
|
||||||
.node ellipse,
|
.node ellipse,
|
||||||
|
@@ -24,8 +24,7 @@ export const drawFace = function(element, faceData) {
|
|||||||
.append('circle')
|
.append('circle')
|
||||||
.attr('cx', faceData.cx)
|
.attr('cx', faceData.cx)
|
||||||
.attr('cy', faceData.cy)
|
.attr('cy', faceData.cy)
|
||||||
.attr('fill', '#FFF8DC')
|
.attr('class', 'face')
|
||||||
.attr('stroke', '#999')
|
|
||||||
.attr('r', radius)
|
.attr('r', radius)
|
||||||
.attr('stroke-width', 2)
|
.attr('stroke-width', 2)
|
||||||
.attr('overflow', 'visible');
|
.attr('overflow', 'visible');
|
||||||
@@ -61,6 +60,7 @@ export const drawFace = function(element, faceData) {
|
|||||||
//mouth
|
//mouth
|
||||||
face
|
face
|
||||||
.append('path')
|
.append('path')
|
||||||
|
.attr('class', 'mouth')
|
||||||
.attr('d', arc)
|
.attr('d', arc)
|
||||||
.attr('transform', 'translate(' + faceData.cx + ',' + (faceData.cy + 2) + ')');
|
.attr('transform', 'translate(' + faceData.cx + ',' + (faceData.cy + 2) + ')');
|
||||||
}
|
}
|
||||||
@@ -74,6 +74,7 @@ export const drawFace = function(element, faceData) {
|
|||||||
//mouth
|
//mouth
|
||||||
face
|
face
|
||||||
.append('path')
|
.append('path')
|
||||||
|
.attr('class', 'mouth')
|
||||||
.attr('d', arc)
|
.attr('d', arc)
|
||||||
.attr('transform', 'translate(' + faceData.cx + ',' + (faceData.cy + 7) + ')');
|
.attr('transform', 'translate(' + faceData.cx + ',' + (faceData.cy + 7) + ')');
|
||||||
}
|
}
|
||||||
@@ -81,12 +82,13 @@ export const drawFace = function(element, faceData) {
|
|||||||
function ambivalent(face) {
|
function ambivalent(face) {
|
||||||
face
|
face
|
||||||
.append('line')
|
.append('line')
|
||||||
|
.attr('class', 'mouth')
|
||||||
.attr('stroke', 2)
|
.attr('stroke', 2)
|
||||||
.attr('x1', faceData.cx - 5)
|
.attr('x1', faceData.cx - 5)
|
||||||
.attr('y1', faceData.cy + 7)
|
.attr('y1', faceData.cy + 7)
|
||||||
.attr('x2', faceData.cx + 5)
|
.attr('x2', faceData.cx + 5)
|
||||||
.attr('y2', faceData.cy + 7)
|
.attr('y2', faceData.cy + 7)
|
||||||
.attr('class', 'task-line')
|
.attr('class', 'mouth')
|
||||||
.attr('stroke-width', '1px')
|
.attr('stroke-width', '1px')
|
||||||
.attr('stroke', '#666');
|
.attr('stroke', '#666');
|
||||||
}
|
}
|
||||||
@@ -128,7 +130,8 @@ export const drawText = function(elem, textData) {
|
|||||||
const textElem = elem.append('text');
|
const textElem = elem.append('text');
|
||||||
textElem.attr('x', textData.x);
|
textElem.attr('x', textData.x);
|
||||||
textElem.attr('y', textData.y);
|
textElem.attr('y', textData.y);
|
||||||
textElem.attr('fill', textData.fill);
|
textElem.attr('class', 'legend');
|
||||||
|
|
||||||
textElem.style('text-anchor', textData.anchor);
|
textElem.style('text-anchor', textData.anchor);
|
||||||
|
|
||||||
if (typeof textData.class !== 'undefined') {
|
if (typeof textData.class !== 'undefined') {
|
||||||
|
@@ -30,6 +30,7 @@ const getStyles = (type, userStyles, options) => {
|
|||||||
return ` {
|
return ` {
|
||||||
font-family: ${options.fontFamily};
|
font-family: ${options.fontFamily};
|
||||||
font-size: ${options.fontSize};
|
font-size: ${options.fontSize};
|
||||||
|
fill: ${options.textColor}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Classes common for multiple diagrams */
|
/* Classes common for multiple diagrams */
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { lighten, rgba } from 'khroma';
|
import { invert, lighten, rgba } from 'khroma';
|
||||||
|
|
||||||
class Theme {
|
class Theme {
|
||||||
constructor() {
|
constructor() {
|
||||||
@@ -6,7 +6,7 @@ class Theme {
|
|||||||
this.mainBkg = '#1f2020';
|
this.mainBkg = '#1f2020';
|
||||||
this.secondBkg = 'calculated';
|
this.secondBkg = 'calculated';
|
||||||
this.mainContrastColor = 'lightgrey';
|
this.mainContrastColor = 'lightgrey';
|
||||||
this.darkTextColor = '#323D47';
|
this.darkTextColor = lighten(invert('#323D47'), 10);
|
||||||
this.lineColor = 'calculated';
|
this.lineColor = 'calculated';
|
||||||
this.border1 = '#81B1DB';
|
this.border1 = '#81B1DB';
|
||||||
this.border2 = rgba(255, 255, 255, 0.25);
|
this.border2 = rgba(255, 255, 255, 0.25);
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { rgba } from 'khroma';
|
import { lighten, rgba } from 'khroma';
|
||||||
|
|
||||||
class Theme {
|
class Theme {
|
||||||
constructor() {
|
constructor() {
|
||||||
@@ -103,7 +103,8 @@ class Theme {
|
|||||||
|
|
||||||
/* Sequence Diagram variables */
|
/* Sequence Diagram variables */
|
||||||
|
|
||||||
this.actorBorder = this.border1;
|
// this.actorBorder = lighten(this.border1, 0.5);
|
||||||
|
this.actorBorder = lighten(this.border1, 23);
|
||||||
this.actorBkg = this.mainBkg;
|
this.actorBkg = this.mainBkg;
|
||||||
this.labelBoxBkgColor = this.actorBkg;
|
this.labelBoxBkgColor = this.actorBkg;
|
||||||
this.signalColor = this.textColor;
|
this.signalColor = this.textColor;
|
||||||
|
Reference in New Issue
Block a user