Appearance
Inline Attributes
All attributes available on inline and text elements (span, b, i, p, h1-h6, etc.). These attributes are inherited by child elements unless overridden.
Font
| Attribute | Type | Default | Description |
|---|---|---|---|
font | font name | Inter | Font family (Google Font name or registered asset font) |
font-family | font name | -- | Alias for font |
font-size | pt, fit | 12pt | Font size, or fit to auto-scale to fill container |
font-size-min | pt | -- | Minimum font size when using font-size="fit" |
font-size-max | pt | -- | Maximum font size when using font-size="fit" |
font-style | normal, bold, italic | normal | Font style |
font-weight | 100-900, named weight | -- | Font weight (overrides font-style for variant selection) |
font-color | colour | black | Text colour |
Text Layout
| Attribute | Type | Default | Description |
|---|---|---|---|
text-align | left, right, center, justify | reading direction | Horizontal text alignment; unset follows the text's own direction |
line-height | number or pt | 1.2 | Line height (number = multiplier, pt = absolute) |
Text Effects
| Attribute | Type | Default | Description |
|---|---|---|---|
underline | true, false | false | Underlines text (inherited by child elements) |
strike-through | true, false | false | Strikes through text (inherited by child elements) |
text-decoration | none, or underline and/or strike-through | -- | Sets underline and strike-through together. none sets both to false; a named value sets its own to true and leaves the other inherited |
text-shadow | pt | -- | Shadow offset distance |
text-shadow-color | colour | -- | Shadow colour |
text-transform | uppercase, lowercase, capitalize, upper, lower, title | -- | Text case transformation (inherited by child elements) |
case | Alias for text-transform | -- | Text case transformation (inherited by child elements) |
Text Behaviour
| Attribute | Type | Default | Description |
|---|---|---|---|
preserve-whitespace | true, false | false | Preserve whitespace and line breaks |
wrap | normal, none | normal | Text wrapping behaviour |
overflow | ellipsis | -- | Overflow handling (ellipsis truncates with ...) |
Conditional and Style
| Attribute | Type | Default | Description |
|---|---|---|---|
show-if | data path | -- | Render only when condition is truthy |
target | string | -- | Link to element with matching id (internal link) |
style | @alias-name | -- | Apply a style alias |
Leader
<leader/> repeats a glyph across the free width of its line, such as the dots between a contents entry and its page number. It takes the font, colour, text-effect and link attributes above, plus:
| Attribute | Type | Default | Description |
|---|---|---|---|
char | visible text | . | The glyph to repeat |
spacing | pt | one space width | Gap between repeats; 0pt with char="_" draws a solid rule |
min-width | pt | two repeats | The shortest the run of dots may be |
xml
<p>Introduction <leader /> 12</p>
<p>Method <leader char="·" spacing="4pt" font-color="#9ca3af" /> 128</p>- Put the leader directly in the text of a block such as
<p>,<h2>or a<frame>. That block fills its column unless you set awidth, so the text after the leader sits at the end of the line. - Whitespace around
<leader />makes no difference to the output. - One space width stays clear at each end of the dots.
- The dots of rows set in the same style line up on shared columns.
- When a title wraps, the dots and the number follow its last line. When the leader's minimum does not fit on that line, the leader and the number move to the next line together when they fit there. A number never splits across lines unless it alone is wider than the column.
targeton the leader links the dotted space, as it does on a<span>.- Repeats are never set closer than 0.5pt apart.
Style every leader in the document with a rule in <styles>:
xml
<styles>
<leader>
<char>-</char>
<spacing>2pt</spacing>
<font-color>#999999</font-color>
</leader>
</styles>Papermill rejects the document with message:
<leader> must be placed directly in the text of an element such as <p>, not inside <span>when a leader sits inside an inline element. The message names that element.<leader> cannot sit directly in a row; put the entry in a <p> or a child framewhen a leader sits directly in adirection="row"frame or cell.<leader> char '…' with spacing '…' must be one run of visible characterswhencharis empty or holds a space.<leader> char '…' with spacing '…' repeats at no width. Use a visible char or a positive spacingwhen neither the glyph nor the spacing has any width.
To build a contents page with leaders, see Table of Contents.