Book a call Free rebuild

Stroke

April 5, 2023 Updated November 16, 2026 2 min read

Design glossaryA stroke is a line, or the outline drawn around a shape or letter. In type, the strokes are the lines that make up each character.

"Stroke" has two related meanings in design. In typography, strokes are the individual lines and curves that make up each letter, as if drawn with a pen. In graphics software and on the web, a stroke is the line drawn along a path or around the edge of a shape, as opposed to the fill inside it.

Strokes in typography

Type designers describe letters by their strokes. The main vertical stroke of a letter, such as the upright of an l or the sides of an n, is the stem. Thin connecting strokes are hairlines, and the horizontal stroke in letters like A, H, and t is the crossbar. The small finishing strokes at the ends of some letters are serifs.

Two stroke properties shape the character of a typeface:

  • Stroke weight: how thick the strokes are overall. A family's light, regular, and bold styles differ mainly in stroke weight (see font weight).
  • Stroke contrast: the difference between the thickest and thinnest strokes. Typefaces like Bodoni and Didot have high contrast, with very thin hairlines that look elegant at large sizes but can break up when small or on low-resolution screens. Many sans serifs have low contrast, with strokes of nearly even thickness that hold up well at small sizes.

For body text on screens, low-to-moderate contrast typefaces are usually the safer choice. High-contrast faces are best kept for large headings.

Strokes in graphics and SVG

In tools such as Figma and Adobe Illustrator, every shape can have a fill, a stroke, or both. The stroke has a width, a color, and settings for line caps, corners, and dashes. Most icon sets are drawn as strokes, which is why "line icons" come in set stroke widths such as 1.5 or 2 pixels.

In SVG, the same ideas are attributes and CSS properties: stroke, stroke-width, stroke-linecap, stroke-linejoin, and stroke-dasharray. A few things catch people out:

  • SVG strokes are centered on the path, half inside and half outside. Design tools can place strokes inside or outside a shape, so an icon may look different once exported unless the stroke is converted to an outline first.
  • Strokes scale with the graphic. An icon drawn at 24 pixels and shown at 48 gets strokes twice as thick. The vector-effect: non-scaling-stroke property keeps the width fixed.
  • Color with currentColor. Setting stroke="currentColor" lets an icon take its color from the surrounding text, so it changes with hover states and themes.

Outlined text on the web

CSS can draw a stroke around text with -webkit-text-stroke, which, despite the prefix, works in all major browsers. Outlined display headings can look striking, but outlined body text is hard to read, and an outline with an empty fill may not meet contrast requirements. For a subtle edge that keeps text readable over images, a text shadow is often the better choice.

WP Services

WordPress services at revolutionary pricing.

Productized WordPress services, from builds to care, delivered by Seahawk and tracked in one app. For the WordPress lovers.