Styling data
Stroke and lines¶
Outlines of polygons and points, and the colour, width and dashes of lines.
Quick reference¶
| Utility | Does | Example |
|---|---|---|
stroke-<colour>stroke-<pixels>stroke-[<expr>] |
Outline or line colour, its width in pixels, or line colour by data | stroke-whitestroke-slate-300/50stroke-1 |
width-[<expr>]width-max-<pixels> |
Line or outline width by data, the widest set by width-max | width-[rank]width-[flow/1000]width-max-10 |
dash-<on>-<off>dash-<n> |
Dashed lines and outlines, in line widths | dash-4-2dash-3dash-1.5-1 |
Colour and width¶
stroke-white stroke-1 gives polygons a one-pixel white outline. On a line layer, stroke- is the line itself, and stroke-[road_class] colours lines by data.
Width by data¶
width-[rank] makes line width follow a column: the widest line is width-max pixels (default 8) and no line is thinner than half a pixel. The legend adds a line-width key.

Dashes¶
dash-4-2 draws 4 units on, 2 off, in multiples of the line width; dash-3 is 3 on, 3 off. Dashes apply to lines and outlines, the way disputed borders and planned routes are drawn.
