Skip to content

Stylesheets ​

A stylesheet is a .pms file that decides how a process is drawn. It is a list of blocks. Each block names a selector and sets properties on it.

css
activity {
    fill: '#ffffff';
    stroke: '#d5dae2';
    text-color: '#1d1d20';
}

Every value is quoted with single quotes and every property ends with a semicolon.

Selectors ​

SelectorMatches
documentThe diagram as a whole.
edgeEvery arrow.
message-flowEvery message flow, the links written with NEXT-MESSAGE. A property it does not set comes from edge.
associationEvery association, the links written with NEXT-ASSOCIATION, and every data association, the links of a DATA or DATABASE. A property it does not set comes from edge.
activity, gateway, event, data, start, end, attachment, subprocessEvery node of that type.
annotationEvery text annotation. A property it does not set comes from attachment.
#idThe single node with that identifier.
swimlaneEvery swimlane. The fill paints the header; the band stays transparent so the document background shows through.
poolEvery pool header and outline. A property it does not set comes from swimlane.
subprocess-groupEvery expanded subprocess container.
css
message-flow {
    stroke: '#2f6fed';
    strokewidth: '1.5';
}

A message flow is always dashed, with an open circle at its source and an open arrowhead at its target. The stylesheet sets its colour and width, not its pattern. None of the predefined stylesheets has a message-flow block, and message flows there take the edge colours.

css
association {
    stroke: '#6b7280';
}

An association is always dotted, without an arrowhead. A data association is dotted with an open arrowhead at its target end. The stylesheet sets its colour and width, not its pattern. None of the predefined stylesheets has an association block, and associations there take the edge colours.

css
pool {
    stroke: '#2f6fed';
    pool-gap: '60';
}

None of the predefined stylesheets has a pool block, and pools there take the swimlane colours.

css
annotation {
    stroke: '#6b7280';
    text-color: '#4b5563';
}

A text annotation draws its bracket in the stroke colour and has no fill. None of the predefined stylesheets has an annotation block, and text annotations there take the attachment colours.

An #id block always wins over an element block, wherever the two appear in the file. Two blocks of the same selector merge, and the later value wins.

Color and line properties ​

PropertyApplies toValue
backgrounddocumentA color.
filledge, element, #id, swimlane, pool, subprocess-groupA color.
strokeedge, message-flow, association, element, #id, swimlane, pool, subprocess-groupA color.
strokewidthedge, message-flow, association, element, #idA number of pixels.
text-colordocument, element, #id, swimlane, pool, subprocess-groupA color.

A color written as an empty value, '', is not set. The selector takes the value it would take without the property.

A property no selector sets takes its default. The defaults draw black outlines, black text and white arrowheads on a white background, with white swimlane and pool headers and unfilled nodes. A stylesheet without declarations looks like Classic Light.

Typography properties ​

PropertyValue
font-familyOne of the available font families.
font-sizeA number of pixels, 6 or more.
font-weightnormal, bold, or a numeric weight such as 600.
font-stylenormal or italic.
line-heightA multiplier of the font size.

Typography is set on document, an element type, an #id, swimlane, pool and subprocess-group. A selector that does not set a typography property or text-color takes the one document sets; a property neither sets keeps its default: Arial, 12 pixels, normal weight, normal style, a line height of 1.2. An arrow label takes the typography of the node it leaves.

The available font families are:

  • Inter
  • Roboto
  • Open Sans
  • Lato
  • Source Sans 3
  • Lora, a serif
  • Montserrat, a geometric sans
  • JetBrains Mono, a monospace

A font-family outside that list is a stylesheet error naming the property and the line. Every available family is embedded in an SVG export. An exported SVG reads the same on a machine where the font is not installed.

Spacing properties ​

PropertyApplies toEffect
node-paddingdocumentThe space between a node, its label included, and the edge of its cell, on every side. Without a value it is 40 pixels left and right and 20 pixels above and below.
node-gapdocumentThe space between two neighbouring node cells, along the flow and across it. Without a value it is 50 pixels.
swimlane-insetswimlane, poolThe space either side of the rotated swimlane label, and on pool either side of the rotated pool label.
pool-gappoolThe smallest space between two pools. Without a value it is 40 pixels.
group-insetsubprocess-groupThe space between a subprocess container and its contents.

Each value is a non-negative number of pixels.

Two neighbouring nodes sit node-padding, node-gap and node-padding apart, measured from the side of one node to the side of the next. A narrower node in a column with a wider one sits centred, further from its neighbours. Arrows run through the node-gap. A gap in which an arrow turns is at least 28 pixels, and a gap with several arrows side by side widens to keep them 14 pixels apart. A gap that no arrow crosses along its whole length takes no space.

css
document {
    node-padding: '16';
    node-gap: '8';
}

Flow direction ​

flow-direction is set on document and takes one of two values.

ValueLayout
left-to-rightThe process flows from left to right. Swimlanes and pools are rows with their label on the left. This is the layout without the property.
top-to-bottomThe process flows from top to bottom. Swimlanes and pools are columns with their label across the top, written horizontally.
css
document {
    flow-direction: 'top-to-bottom';
}

Any other value is a stylesheet error naming the property and the line. The Direction control in the Styling dialog sets the same property.

Shape property ​

shape names one of the built-in shapes and is set on an element type or on an #id:

  • rectangle
  • circle
  • diamond
  • document
  • cylinder
css
activity {
    shape: 'diamond';
}

#urgent-review {
    shape: 'rectangle';
}

A node keeps the shape of its own type when no shape is set. A name outside the list is a stylesheet error naming the property and the line.

Predefined stylesheets ​

NameLook
Classic LightBlack shapes and text on white, in Arial.
Classic DarkWhite shapes and text on near-black, in Arial, with black text inside activities and subprocesses.
Modern LightInter type on a brand-neutral light palette, with a single accent on the start node.
Modern DarkThe same type and spacing as Modern Light, on the dark palette.

Every predefined stylesheet sets text-color on document. Classic Dark sets its own text-color on activity and subprocess, and the Modern stylesheets set their own on swimlane. A text-color on document in a project's override reaches every label the stylesheet does not color on its own selector: events, gateways, data, start and end nodes, arrow labels and subprocess containers.

A project saved before these were renamed keeps working: Light, Dark and Editorial still resolve to Classic Light, Classic Dark and Modern Light.

A company may edit a predefined stylesheet for itself. An owner or admin edits it like any company stylesheet, and every process of the company that uses it then renders the company's version; other companies keep the original. Reset all puts the original back. An owner or admin may also delete a predefined stylesheet from the company's library once no process uses it, and restore it from the trash.

A project picks one of these, or a stylesheet of its tenant, in the styling dialog, and layers its own .pms override on top. The override composes after the stylesheet, and a declaration in the override wins over the same declaration in the stylesheet.

The six color fields in the styling dialog write into the project's override, never into the stylesheet. A color set in a field wins over the stylesheet's color. An empty field shows the stylesheet's color as its placeholder and leaves that color in effect, and clearing a field returns to it. Picking another stylesheet changes the placeholders of the empty fields and leaves the filled fields as they are.