Skip to content
Xerobi Icons

Design specification

The rules every Xerobi icon must or should follow, on the 256 × 256 canvas, with the script that checks each one.

Last updated

This page lists the rules Xerobi icons follow. For pictures and reasoning, see the design language and the design principles.

Rules that a script checks name it in brackets, like [lint stroke]. See the lint rules reference. Everything else is judged in review.

Requirement levels

  • Must and must not mark required rules.
  • Should and should not mark strong recommendations. Deviating needs a reason, which is recorded.
  • May marks something optional.

A documented exception can override a default when it improves meaning, recognisability or rendering. Rules marked must can only be broken when the project records an explicit exception.

Canvas

  1. Icons must use a 256 × 256 canvas, with viewBox="0 0 256 256". [lint root]
  2. The canvas must be square, with its origin at the top left, x to the right and y down.
  3. All geometry must stay inside the 32–224 live area, so a 16-unit stroke leaves at least 24 units to the edge. [lint live-area]
Property Value
Canvas 256 × 256
ViewBox 0 0 256 256
Live area 32 to 224 on both axes
Ink limit (live area plus half the stroke) 24 to 232

Strokes

  1. Strokes must be 16 units wide in the source drawing. The build derives thin (8), light (12) and bold (24). [lint stroke]
  2. Strokes must use round line joins. [lint stroke]
  3. Open paths must use round line caps. [lint stroke]
  4. Strokes must be centred on their paths.
  5. Strokes must be set on the group, not on each shape.
  6. Primary strokes within an icon should have one width. Overlapping strokes should not create heavier regions by accident.
  7. vector-effect="non-scaling-stroke" should not be used: it makes strokes ignore the size the icon is shown at.
Weight Stroke in units At 24 px
Thin 8 0.75 px
Light 12 1.125 px
Regular (the drawing) 16 1.5 px
Bold 24 2.25 px

Corners

  1. Sharp corners should be rounded unless the geometry requires otherwise.
  2. A rectangle should use a corner radius of 16 when it is at least 64 units across on both sides (a card, a window, a device), and 8 on smaller parts inside it. The same applies to quarter-arc corners drawn in paths. Larger radii (24 and up) are drawn roundness and stay.
  3. Corners where lines meet should use the round join rather than a drawn radius when the geometry is a pointed shape (a diamond, a bolt).
  4. Corners should stay sharp where rounding would make the icon render differently at different sizes.

The consistency audit reports corners that break the second rule. [audit corners]

Spacing

  1. Distinct elements must have at least 24 units of open space between them. [lint detail]
  2. Gaps between distinct elements must not be smaller than 24 units.
  3. Inner openings and counters should be at least 24 units wide.
  4. Spacing should stay visually consistent where elements connect or cross.
  5. An element should not end in an abrupt cut where another element visually continues or crosses it. Slash and badge variants get their clearing from the build (16 units around a slash, a round corner of radius 52 around a badge).

Visual weight

  1. An icon should have a visual weight similar to circle and square.
  2. An icon should not look noticeably larger, smaller, heavier or lighter than comparable icons.
  3. A container shape that spans the icon must keep to its keyline (the centre line of the stroke): circle 192, square 176, wider or taller rectangle 192 on the long side. [lint keyline]
  4. Open shapes may use the full live area.
  5. The larger side of an icon should span at least 144 units. Carets, dots and similar small symbols are marked data-size="symbol" instead. [lint small]

Alignment and balance

  1. Icons should look centred in the canvas. [audit centre]
  2. Asymmetric icons may be moved off centre so they look centred.
  3. Symmetric icons should be geometrically centred.
  4. The overall size of an icon should match its neighbours. [audit size]

Visual density

  1. An icon should have a level of detail similar to the other icons.
  2. An icon must have at most eight stroked elements. A repeated simple pattern (a dashed outline, a grid, sun rays) may go over after it has been checked at 16 px and marked data-detail="reviewed". [lint detail]
  3. Details should be simplified when they make an icon look much denser than comparable ones.
  4. Details that are not needed to recognise the concept should be left out. Texture, feathers, fur and small text do not belong.

Curves

  1. Continuous curves should be smooth.
  2. A curve should not have an unintended bump or an abrupt change in curvature.
  3. Arcs and cubic Bézier curves should be used where they describe the shape exactly. Sampled formulas and flattened boolean results must not be saved as many short straight segments (more than 40). [lint tessellated]
  4. A curve that bulges more than one unit past its ends must have an anchor at that extreme. [lint extremes]
  5. Control points of adjoining curves should line up where the curvature should continue.
  6. A curve should not have more control points than it needs.

Coordinates and pixel alignment

  1. The endpoints of straight segments, the centres of circles and the corners of rectangles must be whole numbers. [lint off-grid]
  2. Multiples of 4 are preferred.
  3. Computed or rotated points should be rounded rather than saved with decimals.
  4. Arc radii and curve control points may be any value.
  5. Geometry may leave the grid for visual balance, a recognisable shape or a smooth curve.
  6. Pixel alignment should not take precedence over the visual quality of the icon.

Roles and weights

  1. Every shape must sit in a group with a known data-role: line, detail, area, hole, dot or dotcut. [lint role]
  2. A closed silhouette must have an area, so the fill and duotone weights differ from the outline. Letters, numbers and typographic symbols, where filling would close the counters, are marked data-fill="outline" instead. [lint no-fill]
  3. A dot must use a radius of 16, and a cut-out dot (an eye) 14.
  4. All six weights must come from the one source drawing. There is no per-weight artwork.

See Weights and roles for what each role becomes.

Color and fills

  1. Icons must use currentColor. They must not carry a theme color.
  2. Color must not be needed to understand an icon.
  3. The duotone weight must stay understandable without its second tone, and must not assume a background color.
  4. Brand marks (the Brands category) are drawn in one tone like everything else.

Shared geometry

  1. A -slash icon must be its base icon unchanged plus one slash group. [lint slash]
  2. A badge variant (-plus, -minus, -x, -check, -warning, -question, -heart, -star, -gear, -magnifying-glass, -arrow-up, -arrow-down, -user) must be its base icon unchanged plus the standard badge. If the modifier is drawn into the icon, it is marked data-badge="custom". [lint badge]
  3. Related icons should show shared elements the same way. People follow person (a full figure) and user (a bust).
  4. Common modifiers should use the same geometry, size and place across icons.
  5. Existing geometry may change when another rule needs it.

Text in icons

Text must not appear in an icon unless the text is the concept: Letters and Numbers, the file-type family (file-pdf, file-jpg), text-formatting icons, maths functions and labels like television-4k. Up to three characters, drawn as large stroked letterforms. Text does not scale across weights, so elsewhere use a symbol.

Names, metadata and files

  1. Names must be lowercase words joined by hyphens, at most 40 characters, and must not end in a weight word. [lint name]
  2. An icon must not be drawn identically to another. [lint dup]
  3. An icon must have one category from the list and between 3 and 12 unique, lowercase tags. [lint meta, tags]
  4. Source files must not contain scripts, event handlers, images, filters, gradients, styles, ids, transforms or external references. [lint svg-safe]

See Naming, Metadata and SVG conventions.

Rendering sizes

Review every icon at these sizes, on light and dark backgrounds.

Size Context
12 px Dense interface (check, accept if it degrades gracefully)
16 px Compact controls (must be readable)
20 px Standard controls
24 px The reference size
32 px Prominent controls
48 px Feature or illustrative use

icon.py weights <name> draws all of these for all six weights.

Required visual checks

Before an icon is accepted, confirm that:

  • no stroke is clipped;
  • essential gaps stay open, in the bold weight too;
  • the silhouette is recognisable;
  • the icon looks centred;
  • its weight is right beside related icons;
  • it reads at 16, 20, 24 and 32 px at least;
  • the fill weight is solid where it should be, and the duotone has a visible tint;
  • variants keep their meaning.

Exceptions

A deviation is acceptable when it improves meaning, recognisability or rendering. Record significant ones with the icon, the issue, the decision, the reason and the affected weights or sizes, in Design decisions.

Priority of requirements

When two non-required rules conflict, choose clarity and consistency with the set, in that order. Rules marked must or must not can be broken only through a recorded exception.