Skip to content
Xerobi Icons

Weights and roles

The six weights of Xerobi Icons, how each is made from a single drawing, and how to group shapes so every weight comes out right.

Last updated

Xerobi Icons comes in six weights. A weight is a visual treatment of a concept, not a separate collection of icons: the same set of icons in each, with the same names.

  • Thin
  • Light
  • Regular
  • Bold
  • Fill
  • Duotone
Weight What it is Made from
Thin Outline, 8-unit stroke the line and detail shapes, stroked
Light Outline, 12-unit stroke the same, stroked wider
Regular Outline, 16-unit stroke (the drawing) the same
Bold Outline, 24-unit stroke the same, stroked wider still
Fill Solid shapes area and line merged, then detail, hole and dotcut cut out
Duotone A tinted body behind the lines area at 20 percent opacity, behind the strokes

You draw the regular outline and its roles once. The build makes the other five.

Why one drawing

Designing six weights by hand means six chances for them to drift apart, and six things to fix when an icon changes. Here a weight cannot disagree with another because it is generated from the same shapes. The cost is that an icon has to be drawn so that all six work. That is what the roles are for.

Roles

Every shape sits in a <g data-role="..."> group. The role says what the shape is for.

Role Meaning Outline weights Fill Duotone
line An outline stroke stroked merged into the solid stroked
detail A stroke inside the shape that should read as a cut-out when filled stroked cut out of the solid stroked
area The closed silhouette, the body not drawn the solid body 20 percent tint
hole An opening that must stay open when filled not drawn cut out not drawn
dot A solid dot (radius 16) solid dot merged solid dot
dotcut A dot cut out of the fill, like an eye (radius 14) solid dot cut out solid dot
slash The diagonal of a -slash icon stroked, with a clearing around it same same
badge The standard mark of a variant like -plus stroked, with a clearing around it same same

A worked example: the house

<g data-role="area" fill="currentColor" opacity="0.2">
  <path d="M48 112 L128 44 L208 112 V208 H48 Z"/>
</g>
<g data-role="hole" fill="none">
  <path d="M116 208 V164 A12 12 0 0 1 140 164 V208 Z"/>
</g>
<g data-role="line" fill="none" stroke="currentColor" stroke-width="16"
   stroke-linecap="round" stroke-linejoin="round">
  <!-- walls, roof and the door -->
</g>
  • The area is the whole body of the house. It is what makes the fill weight solid and the duotone tinted.
  • The hole is the door. It stays open in the fill weight so the house still reads as a house.
  • The lines are the outline you see in the four outline weights.

Rules for each weight

Outline weights (thin, light, regular, bold)

  • Keep the same shape in all four. Only the stroke changes.
  • Keep gaps open in bold: strokes are 24 wide there, so parallel strokes that are 24 apart in regular have no space left.
  • Keep details that survive thin: a very small detail that only a 16-unit stroke can carry will look broken in thin.
  • Filled areas in the outline weights are limited to deliberate details such as dots.

Fill

  • The silhouette says the same thing as the outline.
  • Counters and openings that matter stay open (hole).
  • Strokes that should read as cut-outs go in detail.
  • Letters, numbers and typographic symbols stay outlined: filling would close the counters. Mark them data-fill="outline".
  • Open-stroke icons (an arrow, a line) have nothing to fill, so their fill weight looks the same as regular. That is expected, and the site says so.

Duotone

  • The tint (area) carries the body; the lines carry the meaning.
  • It must stay understandable if the tint is gone.
  • It must work on any background; the tint is 20 percent of the icon’s own color.

Mixing weights

Every weight shares one grid, so swapping between them does not move or resize an icon. Common patterns:

  • Regular for most interface icons, bold for emphasis.
  • Regular for inactive and fill for active (tab bars, toggles, favourites).
  • Duotone for illustrations and feature lists, where the second tone adds depth.
  • One weight per toolbar or list. Do not mix thin and bold side by side.

Missing variants

Not every concept has to look good in every weight. A weight is only worth having when it can show the concept clearly, adds value and keeps its identity. If an icon cannot be drawn so that all six work, simplify the icon rather than special-casing a weight. See Fixing a weight.

Reviewing a weight

  • Individually, and next to its other weights.
  • Next to other icons of the same weight.
  • At common sizes, on light and dark backgrounds.

icon.py weights <name> draws all of this on one sheet.