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. 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 shipped 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. The stylesheet sets its colour and width, not its pattern. None of the shipped stylesheets has an association block, and associations there take the edge colours.

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

None of the shipped 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 shipped 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-colorelement, #id, swimlane, pool, subprocess-groupA color.

Typography properties ​

PropertyValue
font-familyOne of the shipped font families.
font-sizeA number of pixels.
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 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 shipped font families are:

  • Inter
  • Roboto
  • Open Sans
  • Lato
  • Source Sans 3

A font-family outside that list is a stylesheet error naming the property and the line. Every shipped 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's shape and the edge of its cell.
node-gapdocumentThe space between neighbouring cells.
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.

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.

Shipped stylesheets ​

NameLook
Classic LightBlack shapes and text on white, in Arial.
Classic DarkWhite shapes and text on near-black, in Arial.
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.

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

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.