mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-19 15:30:03 +02:00
fix: update styling to match Agros
on-behalf-of: @Mermaid-Chart <hello@mermaidchart.com>
This commit is contained in:
@@ -33,10 +33,7 @@ const getStyles = (options: FlowChartStyleOptions) =>
|
|||||||
background-color: ${fade(options.tertiaryColor, 0.5)};
|
background-color: ${fade(options.tertiaryColor, 0.5)};
|
||||||
}
|
}
|
||||||
|
|
||||||
.edgeLabel .label {
|
|
||||||
fill: ${options.nodeBorder};
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.label {
|
.label {
|
||||||
font-family: ${options.fontFamily};
|
font-family: ${options.fontFamily};
|
||||||
@@ -67,6 +64,14 @@ const getStyles = (options: FlowChartStyleOptions) =>
|
|||||||
fill: none !important;
|
fill: none !important;
|
||||||
stroke: ${options.lineColor} !important;
|
stroke: ${options.lineColor} !important;
|
||||||
stroke-width: 1;
|
stroke-width: 1;
|
||||||
|
}
|
||||||
|
.background {
|
||||||
|
fill: ${options.tertiaryColor};
|
||||||
|
opacity: 0.7;
|
||||||
|
background-color: ${options.tertiaryColor};
|
||||||
|
rect {
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
@@ -2,6 +2,7 @@ import { getConfig } from '../../diagram-api/diagramAPI.js';
|
|||||||
import type { DiagramDB } from '../../diagram-api/types.js';
|
import type { DiagramDB } from '../../diagram-api/types.js';
|
||||||
import { log } from '../../logger.js';
|
import { log } from '../../logger.js';
|
||||||
import type { Node, Edge } from '../../rendering-util/types.js';
|
import type { Node, Edge } from '../../rendering-util/types.js';
|
||||||
|
import { shouldUseHtmlLabels } from '../../utils.js';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
setAccTitle,
|
setAccTitle,
|
||||||
@@ -319,7 +320,7 @@ export class RequirementDB implements DiagramDB {
|
|||||||
const isContains = relation.type === this.Relationships.CONTAINS;
|
const isContains = relation.type === this.Relationships.CONTAINS;
|
||||||
|
|
||||||
let relationLabel = `<<${relation.type}>>`;
|
let relationLabel = `<<${relation.type}>>`;
|
||||||
if (!config.htmlLabels) {
|
if (!shouldUseHtmlLabels()) {
|
||||||
relationLabel = relationLabel.replace(/</g, '<').replace(/>/g, '>');
|
relationLabel = relationLabel.replace(/</g, '<').replace(/>/g, '>');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -176,8 +176,9 @@ function updateTextContentAndStyles(tspan: any, wrappedLine: MarkdownWord[]) {
|
|||||||
if (index === 0) {
|
if (index === 0) {
|
||||||
innerTspan.text(word.content);
|
innerTspan.text(word.content);
|
||||||
} else {
|
} else {
|
||||||
// TODO: check what joiner to use.
|
const prev = wrappedLine[index - 1].content;
|
||||||
innerTspan.text(' ' + word.content);
|
const insertSpace = !prev.endsWith('<') && !word.content.startsWith('>');
|
||||||
|
innerTspan.text((insertSpace ? ' ' : '') + word.content);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user