DiagramStyle Class

The look of an element of a diagram, the CSS properties of the style and classDef statements of Mermaid. A property that is null keeps the value of the theme.

public sealed class DiagramStyle : IEquatable<DiagramStyle>
Implements

Constructors

NameDescription
DiagramStyle()

DiagramStyle()

public DiagramStyle()

No documentation is available.

Properties

NameDescription
BoldGets a value that indicates whether the text is bold (CSS font-weight).
FillGets the color of the interior (CSS fill).
FontSizeGets the size of the text, in pixels (CSS font-size).
ItalicGets a value that indicates whether the text is italic (CSS font-style).
OpacityGets the opacity of the element, from 0 to 1 (CSS opacity).
StrokeGets the color of the outline, or of the line of an edge (CSS stroke).
StrokeDashArrayGets the lengths of the dashes and gaps of the outline, or an empty list for a solid outline (CSS stroke-dasharray).
StrokeWidthGets the width of the outline, or of the line of an edge (CSS stroke-width).
TextColorGets the color of the text (CSS color).

Gets a value that indicates whether the text is bold (CSS font-weight).

public bool? Bold { get; init; }

Property value

bool?

Gets the color of the interior (CSS fill).

public SceneColor? Fill { get; init; }

Property value

SceneColor?

Gets the size of the text, in pixels (CSS font-size).

public double? FontSize { get; init; }

Property value

double?

Gets a value that indicates whether the text is italic (CSS font-style).

public bool? Italic { get; init; }

Property value

bool?

Gets the opacity of the element, from 0 to 1 (CSS opacity).

public double? Opacity { get; init; }

Property value

double?

Gets the color of the outline, or of the line of an edge (CSS stroke).

public SceneColor? Stroke { get; init; }

Property value

SceneColor?

StrokeDashArray

DiagramStyle.cs

Gets the lengths of the dashes and gaps of the outline, or an empty list for a solid outline (CSS stroke-dasharray).

public IReadOnlyList<double>? StrokeDashArray { get; init; }

StrokeWidth

DiagramStyle.cs

Gets the width of the outline, or of the line of an edge (CSS stroke-width).

public double? StrokeWidth { get; init; }

Property value

double?

Gets the color of the text (CSS color).

public SceneColor? TextColor { get; init; }

Property value

SceneColor?

Methods

NameDescription
Equals(DiagramStyle?)
Equals(object?)
GetHashCode()
Merge(DiagramStyle?)Returns a style whose properties are the ones of other when they are set, and the ones of this style otherwise.
ToString()

Equals overloads

Equals(DiagramStyle?)

public bool Equals(DiagramStyle? other)
Parameters
other DiagramStyle?
Returns

bool

No documentation is available.

Equals(object?)

public override bool Equals(object? obj)
Parameters
obj object?
Returns

bool

No documentation is available.

GetHashCode()

public override int GetHashCode()

Returns

int

No documentation is available.

Merge(DiagramStyle?)

DiagramStyle.cs

Returns a style whose properties are the ones of other when they are set, and the ones of this style otherwise.

public DiagramStyle Merge(DiagramStyle? other)

Parameters

other DiagramStyle?
The style that takes precedence, or null.

Returns

DiagramStyle The combined style.

ToString()

public override string ToString()

Returns

string

No documentation is available.

Operators

NameDescription
operator ==(DiagramStyle?, DiagramStyle?)
operator !=(DiagramStyle?, DiagramStyle?)

operator ==(DiagramStyle?, DiagramStyle?)

public static bool operator ==(DiagramStyle? left, DiagramStyle? right)

Parameters

left DiagramStyle?
right DiagramStyle?

Returns

bool

No documentation is available.

operator !=(DiagramStyle?, DiagramStyle?)

public static bool operator !=(DiagramStyle? left, DiagramStyle? right)

Parameters

left DiagramStyle?
right DiagramStyle?

Returns

bool

No documentation is available.