Skip to content

Style vocabulary

Styles in nifdi are named semantic properties, not CSS. A property says what a thing isfill-colour, corner-radius, marker-end — and the renderer decides how to draw it. That is what lets the same diagram come out identically from the canvas and from an agent.

Two things follow from the names being nifdi’s own rather than CSS’s:

  • British spelling throughout. It is fill-colour, border-colour, text-colour. colour with a u is the property name; there is no color alias to fall back on.
  • No cascade, no inheritance. A property is set on an object or it is not. Nothing is inherited from a container by the blocks inside it.

Every table below is generated at build time from the style model. A property the model does not have cannot appear here, and a property the model gains but nobody has described fails the test suite.

The surface the diagram sits on. There is one canvas style per diagram.

PropertyValueWhat it does
fill-colourcolourColour painted inside the shape, or none to leave it transparent.
pattern-typeone ofnonedotsgridWhich repeating pattern the canvas draws behind the diagram.
pattern-sizenumberSpacing in pixels between the canvas pattern marks.
pattern-colourcolourColour of the canvas pattern marks.

Shapes that hold other objects — the block type you get by dragging on empty canvas.

PropertyValueWhat it does
modeone ofopengroupWhether a container is open, so its children select individually, or sealed as a group.
corner-radiusnumberRadius in pixels of a rounded corner, or of the bend where a path turns.
border-widthnumberThickness in pixels of the outline drawn around a shape.
border-colourcolourColour of the outline drawn around a shape.
border-styleline styleWhether the outline is solid or dashed, and how the dashes repeat.
backgroundbackgroundWhat fills the shape behind its contents.
drop-shadowdrop shadowThe shadow cast by the shape, or none.
connector-factoryconnector nameWhich connector shape new paths leaving this object are drawn with.

Text objects, including the labels that live inside containers and along paths.

PropertyValueWhat it does
text-colourcolourColour of the glyphs.
font-sizenumberHeight of the glyphs in pixels.
font-weightnumberWeight of the glyphs, on the usual 100–900 scale.
font-familyfont nameName of the font, taken from the Google Fonts catalogue.
letter-spacingnumberExtra space in pixels inserted between glyphs.
new-line-behaviourone ofpeerparentWhether a new line becomes a sibling of this text or a child of its parent.
connector-factoryconnector nameWhich connector shape new paths leaving this object are drawn with.

Icon blocks drawn from the AWS, Azure, GCP and generic libraries.

PropertyValueWhat it does
label-factorylabel nameWhich text object is created when an icon is labelled.
connector-factoryconnector nameWhich connector shape new paths leaving this object are drawn with.
colourcolourColour of the icon glyph, or of the shadow it casts.

The connectors between blocks. Both ends carry a marker of their own.

PropertyValueWhat it does
corner-radiusnumberRadius in pixels of a rounded corner, or of the bend where a path turns.
path-colourcolourColour of the line.
path-widthnumberThickness in pixels of the line.
outline-colourcolourColour of the outline drawn behind the line, separating it from what it crosses.
outline-widthnumberThickness in pixels of the outline drawn behind the line, or 0 for no outline.
line-styleline styleWhether the line is solid or dashed, and how the dashes repeat.
marker-startmarkerThe arrow head or line cap drawn where the path begins.
marker-endmarkerThe arrow head or line cap drawn where the path ends.
clearancenumberMinimum gap in pixels a path keeps from the objects it routes past.

Margins are not stored on the style like the properties above; they are addressed by these names in the inspector and from code. Where two neighbours ask for different margins, the larger one wins.

PropertyValueWhat it does
marginnumberMinimum space this object keeps from its neighbours on every side.
margin-leftnumberMinimum space this object keeps from its neighbours on the left.
margin-rightnumberMinimum space this object keeps from its neighbours on the right.
margin-topnumberMinimum space this object keeps from its neighbours above.
margin-bottomnumberMinimum space this object keeps from its neighbours below.

Four properties above do not take a scalar. Each takes a small record of its own properties, or the single word none.

The value a container's background property takes, or none for a transparent shape.

PropertyValueWhat it does
fill-colourcolourColour painted inside the shape, or none to leave it transparent.

The value a container's drop-shadow property takes, or none for no shadow.

PropertyValueWhat it does
offset-xnumberHow far the shadow is displaced horizontally, in pixels.
offset-ynumberHow far the shadow is displaced vertically, in pixels.
std-deviationnumberStandard deviation of the Gaussian blur applied to the shadow.
colourcolourColour of the shadow.
opacitynumberOpacity of the shadow, from 0 to 1.

The value a path's marker-start and marker-end properties take.

PropertyValueWhat it does
marker-widthnumberSize of the arrow head measured across the line.
marker-lengthnumberSize of the arrow head measured along the line.
gapnumberSpace between the end of the line and the object it is attached to.
marker-styleone oftriangledartsquare-chevronround-chevronclipped-chevronflat-chevronchamfersquare-capround-capcircleringWhich arrow head or line cap shape is drawn.

The value a border-style or line-style property takes when it is not solid.

PropertyValueWhat it does
repeat-distancenumberLength in pixels of one dash plus one gap.

Where one path crosses another, the hop drawn over the crossing carries its own style.

PropertyValueWhat it does
backgroundbackgroundWhat fills the shape behind its contents.
connector-factoryconnector nameWhich connector shape new paths leaving this object are drawn with.

Styles are addressed by selector when an agent applies them. Selector matching follows the diagram’s structure, including containment and attachment.