format

Returns a formatted string for displaying mixed-format text in the text-field property. The input may contain a string literal or expression, including an #types-image expression. Strings may be followed by a style override object that supports the following properties:

  • "text-font": Overrides the font stack specified by the root layout property.

  • "text-color": Overrides the color specified by the root paint property.

  • "font-scale": Applies a scaling factor on text-size as specified by the root layout property.

fun format(block: Expression.FormatBuilder.() -> Unit)