Reference · docs/reference/construction.md
03 · Construction
How every Cardsite icon is built. If a drawing breaks a rule here, the drawing is wrong, not the rule. If the rule is wrong, change it here first, then redraw every icon it touches.
The canvas
| Value | |
|---|---|
| Grid | 24 × 24 units. 1 unit = 1 px at 24 px |
| Live area | 2.5 → 21.5 on centrelines. Regular's outer edge reaches 1.625 → 22.375, Bold's 1.25 → 22.75 |
| Padding | ≥ 1.25 units of clear canvas on every side in every style |
| Coordinates | Stroke centrelines. Snap to 0.25; prefer .5 and whole numbers |
Keyline shapes (centrelines)
| Shape | Geometry | Use |
|---|---|---|
| Circle | r 9 at 12,12 | discs, globes, clocks, status |
| Square | 3.5 → 20.5, rx 3 | containers that are square by nature |
| Portrait | x 4.5 → 19.5, y 2.5 → 21.5, rx 2.5 | documents, phones, badges |
| Landscape | x 2.5 → 21.5, y 5 → 19, rx 3 | cards, windows, mail, images |
| Triangle | 12,3 · 21.5,19.75 · 2.5,19.75, corner r 2.25 | warnings, play overshoots to 4→20 |
Optical sizing is built into the keylines: the circle is 1 unit larger than the square so both look equal; pointed shapes (triangles, play, stars) overshoot by 0.5–1.
Weights
All five styles are generated from one source drawing. Nobody draws Bold or Fill by hand.
| Style | Stroke | Knockout gap | Dot (default) | Use |
|---|---|---|---|---|
| Light | 1.25 | 1.25 | r 1.15 | large display sizes (≥ 32 px), editorial, marketing |
| Regular | 1.75 | 1.5 | r 1.4 | the default, 16–24 px UI |
| Bold | 2.5 | 1.75 | r 1.775 | toolbars on busy surfaces, active nav state, ≤ 16 px |
| Duotone | 1.75 + plate at 20 % | 1.5 | r 1.4 | feature lists, empty states, marketing |
| Fill | 2.0 + solid body | 1.5 | r 1.65 | selected and active states, toasts, alerts, tab bars (Studio's "fill weight") |
Strokes grow around the centreline, so Bold gains 0.375 on each side over Regular. Because the live area is defined on centrelines, every style keeps at least 1.25 units of clear canvas.
The line
- Flat terminals. Every open end is cut square to its direction (butt cap). Precision lives at the ends.
- Round turns. Every join is rounded by the engine; deliberate corners use fillets (
data-r) from the radius scale. - Three angles. 0°, 45°, 90°. Other angles only when the object demands them (a star, a gear tooth, a play triangle, the long leg of a tick).
- One weight per icon. No hairlines, no doubled strokes, no thick-thin.
- Arcs are circular and their radii come from the scale.
Radius scale
| Token | Value | Where |
|---|---|---|
| r-xs | 1 | polyline fillets, small notches |
| r-sm | 1.5 | small containers < 8 units |
| r-md | 2 | containers 8–13 units, polygon fillets |
| r-lg | 2.5 | portrait keyline, triangle |
| r-xl | 3 | containers ≥ 14 units (square, landscape) |
| fold | 2 | the inner corner of the document fold |
Nothing is rounder than r-xl. A container must never look like a pill unless it is a pill (toggle, input, tag).
The document
Every page-like thing (file*, note, template, page, file-type symbols) uses one document, drawn once:
body: M4.5 5a2.5 2.5 0 0 1 2.5-2.5H14l5.5 5.5V19a2.5 2.5 0 0 1-2.5 2.5H7a2.5 2.5 0 0 1-2.5-2.5Z
fold: M14 2.5V6a2 2 0 0 0 2 2h3.5
- A 45° corner cut with the fold drawn inside it, rounded at r-md. It reads as a page at every size and in every style.
- The symbol inside a document (lines, a picture, brackets) sits in the body below the fold, roughly y 10 → 18.
- Note: 7.0 used a concave "Turn" corner here. It was retired in 7.1 (ADR 0007).
Detail and spacing
| Rule | Value |
|---|---|
| Gap between parallel centrelines | ≥ 3.5 (Bold then keeps 1 unit of air); prefer 4 |
| Counter (inner hole) | ≥ 4 across at Regular |
| Text lines inside a container | centrelines 3.5 apart, inset ≥ 4 from the container line |
| Shortest stroke | 2 units (shorter reads as a dot: use a dot) |
| Dot | class="dot", default r 1.4, tracks weight |
Knockouts
When one object sits in front of another, the front one gets class="ko" (cuts around its line) or class="front" (also hides whatever lies inside its closed area — use it for a card over a card, a badge over a body). The engine cuts everything beneath it back by the knockout gap, then draws it. Never fake this with white fills.
- Modifiers (plus, minus, check, x, dot, arrow) are always lines, never solid shapes, in one of two places:
- inside the body, centred in it, when the body is a container with room (document, folder, calendar, cloud). In Fill they cut out of the solid body.
- bottom-right otherwise (people, globes, clocks, objects without room), centred near 18,18, spanning ≈ 14.5 → 21.5, with
ko. In Fill the plate is notched around them (tools/icons/notch.mjs).
- Clocks share one face and one hand set: face r 9 at 12,12 (smaller in composites, same proportions), hands
12,7 → 12,12 → 15.5,15.5. - Stacked objects (copy, gallery, workspace, layers) share one construction: back card offset 3.5 up and right (the parallel-centreline minimum, so Bold and Fill stay apart), same radius as the front, drawn as an L where it shows. In Fill only the front card is solid; the back stays a line.
- Signal dot (unread, new, live) sits at 18,5.5, r 2.75,
class="dot ko". - Off / disabled slash runs 3.5,3.5 → 20.5,20.5 with
ko. - Overlapping people / cards / layers: the front one is
ko.
Plates (Duotone and Fill)
A plate is the filled silhouette of the main object: class="plate", drawn before the lines.
- One plate per icon, on the thing the icon is about (the card, the bubble, the document, the shield). Never on modifiers or details.
- Open glyphs with no body (arrows, chevrons, plus, close, menu) have no plate. In Duotone they render as Regular, and in Fill as a 2.0 line. That is correct.
- The engine subtracts lines from the plate, so the two layers never overlap.
Fill
Fill is generated from the same source:
- The plate becomes solid.
- Line work inside the plate becomes negative space, cut at the line's own width. It stops 0.35 short of the outline, so the silhouette stays closed.
- Line work outside the plate stays a 2.0 line.
- Lines marked
class="cut"are cut through the whole body, up to the outline. The outline itself stays whole, so the silhouette never breaks. Use it for the document fold (the flap separates from the page) and for dividers (grids, title bars).
When the plate alone would leave Fill half-empty (a person's shoulders, the second person in users, every finder in qr-code), add a fill-only region with class="plate-fill". It is used by Fill and ignored by Duotone.
When a modifier (a plus, a link, a lock) sits on a body, notch the plate around it so the modifier stays a clear line beside the solid: node tools/icons/notch.mjs "<plate d>" "<modifier d>" prints the notched plate. Rerun it whenever the modifier moves.
Fill is right when it reads as the same object as Regular, made solid. Check every icon's Fill row on its QA sheet: a solid body, crisp negative details, no slivers, and no detail lost to the fill.
Silhouette first
Every icon must be recognisable as a filled silhouette at 16 px. The v6 audit found 95 icons whose silhouette was just a disc or a rounded square. Rules that prevent that:
- Use a circle or square container only when the container is the meaning (status discs,
stop, checkbox-like states,-circlevariants that exist for a reason). - Prefer the object itself over the object-in-a-box.
- Siblings share a base and vary one part (
volume-*,align-*,calendar-*,file-*). Draw the base once and copy it.
Source format
Sources are plain SVG in src/icons/<category>/<name>.svg:
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor">
<rect class="plate" x="2.5" y="5" width="19" height="14" rx="3"/>
<rect x="2.5" y="5" width="19" height="14" rx="3"/>
<polyline points="3,6.5 12,13 21,6.5" data-r="1"/>
</svg>
| Markup | Meaning |
|---|---|
| any shape | stroked at the style's weight |
class="plate" |
the body: Duotone tint and Fill solid |
class="plate-fill" |
extra solid region for Fill only |
class="cut" |
a line that Fill cuts through the whole solid body, up to the outline (document folds, dividers) |
class="solid" |
filled shape that grows/shrinks with the weight |
class="dot" |
dot at cx,cy; r is the Regular radius |
class="ko" |
knock out everything beneath this shape's stroke before drawing |
class="front" |
occlude: a closed shape also hides everything inside its area, then knocks out |
data-r |
fillet every corner of a polyline/polygon |
transform="rotate(a cx cy)" |
allowed on shapes and groups |
stroke-dasharray |
allowed (dashed border only) |
Order matters: later shapes are in front.
Naming
- kebab-case, object first, modifier last:
file-plus,user-check,calendar-plus,cloud-upload. - States as suffixes:
-off,-dot,-open,-check. -circleonly when the circle is part of the meaning (check-circle,x-circle), never as a styling variant. Containers are a component concern (see using icons), not a name.- Name what it is, not where it is used:
globe, notlanguage-settings. Use tags for the uses. - Old names live on as
aliasesin the manifest; they resolve but are never shown in pickers.
Review checklist (every icon, every time)
- Renders at 16, 20, 24 in all five styles, on light and dark (
make qa). - Silhouette is not a plain disc or square unless intended.
- Centrelines within 2.5 → 21.5 (Regular outer edge within 1.625 → 22.375).
- Gaps ≥ 3.5 between parallel strokes; Bold does not fill in.
- Only 0/45/90 unless the object demands otherwise.
- Siblings align: same base, same proportions, same modifier position.
- Duotone plate is on the main object only.
make lintpasses.