diff --git a/packages/mermaid/src/rendering-util/rendering-elements/shapes/handdrawnStyles.ts b/packages/mermaid/src/rendering-util/rendering-elements/shapes/handdrawnStyles.ts index 5f8162566..10c36bfad 100644 --- a/packages/mermaid/src/rendering-util/rendering-elements/shapes/handdrawnStyles.ts +++ b/packages/mermaid/src/rendering-util/rendering-elements/shapes/handdrawnStyles.ts @@ -41,7 +41,26 @@ export const styles2String = (node: Node) => { stylesArray.forEach((style) => { const key = style[0]; - if (key === 'color') { + if ( + key === 'color' || + key === 'font-size' || + key === 'font-family' || + key === 'font-weight' || + key === 'font-style' || + key === 'text-decoration' || + key === 'text-align' || + key === 'text-transform' || + key === 'line-height' || + key === 'letter-spacing' || + key === 'word-spacing' || + key === 'text-shadow' || + key === 'text-overflow' || + key === 'white-space' || + key === 'word-wrap' || + key === 'word-break' || + key === 'overflow-wrap' || + key === 'hyphens' + ) { labelStyles.push(style.join(':') + ' !important'); } else { nodeStyles.push(style.join(':') + ' !important');