Span

Span changes inherited style for part of a Text element. Its children may be strings, numbers, nested Spans, inline elements, and arrays. It has no independent box during inline layout: padding, width, and flex allocation do not create an inline badge or a separately positioned run.

Font family, size, weight, style, color, halo color/width, and line height may be overridden. em or fractional font-size is relative to the surrounding font size. Nested Spans inherit the resolved style of their containing Span. Use color, not fill, for glyph color.

Use halo-color={none} or halo-width={0} to disable an inherited text halo for one span. Halo widths in em or fractions use the span's local font size.

Styled runs share line breaking and baselines. A Span boundary inside a word does not create a new break opportunity, and a style-equivalent Span does not break kerning. Larger runs contribute their own font metrics to the shared line box. An embedded element receives the span's resolved style and contributes its own logical baseline extents. A formula inherits font size and color while retaining its math faces. Span itself provides no superscript, subscript, or arbitrary baseline shift.

Keep literal text on one source line, use text expressions, or include newlines intentionally: Text retains explicit newlines. The example mixes styles within one paragraph and highlights the middle of an otherwise unbroken word.