highlight
ElementElement functions can be customized with set
and show
rules.
set
and show
rules.Highlights text with a background color.
Example
This is #highlight[important].

ParametersParameters are the inputs to a function. They are specified in parentheses after the function name.
fill
SettableSettable parameters can be customized for all following uses of the function with a set
rule.
set
rule.The color to highlight the text with. (Default: 0xffff5f)
Default: rgb("#ffff5f")
View example
This is #highlight(fill: blue)[with blue].

top-edge
length or stringSettableSettable parameters can be customized for all following uses of the function with a set
rule.
set
rule.The top end of the background rectangle.
"ascender"
The font's ascender, which typically exceeds the height of all glyphs.
"cap-height"
The approximate height of uppercase letters.
"x-height"
The approximate height of non-ascending lowercase letters.
"baseline"
The baseline on which the letters rest.
"bounds"
The top edge of the glyph's bounding box.
Default: "ascender"
View example
#set highlight(top-edge: "ascender")
#highlight[a] #highlight[aib]
#set highlight(top-edge: "x-height")
#highlight[a] #highlight[aib]

bottom-edge
length or stringSettableSettable parameters can be customized for all following uses of the function with a set
rule.
set
rule.The bottom end of the background rectangle.
"baseline"
The baseline on which the letters rest.
"descender"
The font's descender, which typically exceeds the depth of all glyphs.
"bounds"
The bottom edge of the glyph's bounding box.
Default: "descender"
View example
#set highlight(bottom-edge: "descender")
#highlight[a] #highlight[ap]
#set highlight(bottom-edge: "baseline")
#highlight[a] #highlight[ap]

extent
SettableSettable parameters can be customized for all following uses of the function with a set
rule.
set
rule.The amount by which to extend the background to the sides beyond (or within if negative) the content.
Default: 0pt
View example
A long #highlight(extent: 4pt)[background].

body
The content that should be highlighted.