status.span¶
status.span(
spec,
) -> {
kind: "span",
text: string,
fg: number | string?,
bg: number | string?,
bold: boolean?,
italic: boolean?,
underline: boolean?,
dim: boolean?,
reverse: boolean?,
strikethrough: boolean?,
} | {
kind: "fill",
glyph: string?,
fg: number | string?,
bg: number | string?,
bold: boolean?,
italic: boolean?,
underline: boolean?,
dim: boolean?,
reverse: boolean?,
strikethrough: boolean?,
}
Build a styled span of text.
Accepts { text = "...", fg = <color>, bg = <color>, bold = true,
italic = true, underline = true, dim = true, reverse = true,
strikethrough = true }; a color is a "#rrggbb" hex string, a color
name, a CSS color spec, or a palette index 0-255. Returns a span
element for status.flat or a status.zones group.
Parameters
spec:{text: string, fg: number | string?, bg: number | string?, bold: boolean?, italic: boolean?, underline: boolean?, dim: boolean?, reverse: boolean?, strikethrough: boolean?}text— The text of the run, unsanitized. Sanitization is deferred to the layout pass.fgbgbolditalicunderlinedimreversestrikethrough
Returns
{kind: "span", text: string, fg: number | string?, bg: number | string?, bold: boolean?, italic: boolean?, underline: boolean?, dim: boolean?, reverse: boolean?, strikethrough: boolean?} | {kind: "fill", glyph: string?, fg: number | string?, bg: number | string?, bold: boolean?, italic: boolean?, underline: boolean?, dim: boolean?, reverse: boolean?, strikethrough: boolean?}kindtext— The text of the run, unsanitized. Sanitization is deferred to the layout pass.fgbgbolditalicunderlinedimreversestrikethroughkindglyph— The glyph to repeat. Absent defaults to a space in the layout pass. An empty string is a parse error.fgbgbolditalicunderlinedimreversestrikethrough