Gallery

71 figures · Open a figure to explore its code.

layout (11)

geometry (10)

plotting (16)

maps (9)

networks (6)

text (5)

math (12)

api (2)

(text_halos)

Text halos

Both panels use the same lines, labels, positions, and font sizes. The right panel inherits halo-color={white} from its graph. The default halo-width of em(0.08) follows each label's font size; use px(...) for a fixed outward extent.

Halos paint beneath all foreground runs in a Text element, including styled spans. They enlarge ink bounds without changing wrapping, baselines, or label placement. On a dark background, choose a dark halo and light text. The halo color is explicit; it does not sample the background.

Use halo-color={none} or halo-width={0} to turn off an inherited halo. Generated labels accept scoped props such as label-halo-color. Ordinary live text retains its selectable foreground. Math labels and color emoji remain unchanged.