#1224 Possibility to style text color of nodes and subgraphs as well as apply classes to subgraphs

This commit is contained in:
Knut Sveidqvist
2020-02-05 19:39:50 +01:00
parent 4d5ecc5518
commit 822df37f8c
4 changed files with 50 additions and 2 deletions

View File

@@ -533,11 +533,18 @@ const render = function(id, _txt, cb, container) {
// classDef
if (graphType === 'flowchart') {
const classes = flowRenderer.getClasses(txt);
console.log('classes in mermaidApi', classes);
for (const className in classes) {
style += `\n.${className} > * { ${classes[className].styles.join(
' !important; '
)} !important; }`;
if (classes[className].textStyles) {
style += `\n.${className} tspan { ${classes[className].textStyles.join(
' !important; '
)} !important; }`;
}
}
console.log(style);
}
const style1 = document.createElement('style');