mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-15 21:39:40 +02:00
#1224 Possibility to style text color of nodes and subgraphs as well as apply classes to subgraphs
This commit is contained in:
@@ -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');
|
||||
|
Reference in New Issue
Block a user