Search
DiagramItem.style Property
See Also
 





Gets or sets the style associated with this item.

Namespace: MindFusion.Diagramming
File: DiagramItem.js

 Syntax

JavaScript  Copy Code

get style() {}
set style(value) {}

 Property Value

Style

An instance of the Style class.

 Remarks

Individual properties of DiagramItem have higher priority than ones set through a Style object. If neither are set, values are inherited from Diagram's style or from current theme.

 Note

As of version 4.9 of the library, items can also by styled via CSS, where a custom CSS property name inside a declaration matches respective Style property, but is hyphenated, and type selectors match item type name with added mfd- prefix. For example:

mfd-shapenode {
    --brush: lightblue;
    --stroke: blue;
    --stroke-thickness: 2px;
    --font-name: 'Verdana';
    --font-size: 12px;
}

You can also associate CSS rules with individual items by setting cssClass property and specifying it in class selectors.

 See Also