Examples
Attributes resolved for HTML.
Every element below carries the attributes shown above it, and the filter resolves them for HTML as this page is rendered. The Typst preview is the same mechanism resolving the other way.
This site turns on warn-on-drop, so a mistyped prefix on these pages is reported rather than lost:
extensions:
prism:
warn-on-drop: trueatelier-html: and html: match here
These pages are rendered by the atelier-html format, a Quarto custom format based on html. The prefix is matched against the custom format name and against its base format, so both atelier-html: and html: apply. The examples below use atelier-html:, the more specific of the two.
That is the same rule the Reference states for mcanouil-typst and typst.
Because these pages deliberately carry prefixes for formats they are not built as, the render reports a handful of drops every time. That is the option working, not a fault.
An exact match
::: {atelier-html:style="color: firebrick;" typst:style="color: rgb(0,0,255);"}
Firebrick here, blue in the PDF.
:::Firebrick here, blue in the PDF.
The typst: attribute is dropped from this page, and the atelier-html: one from the PDF.
A base format match
A custom format also matches the prefix of its base format. When both prefixes name the same attribute, the custom format name wins.
::: {html:style="color: darkorange;" atelier-html:style="color: firebrick;"}
Firebrick here, because `atelier-html:` is more specific than `html:`.
:::Firebrick here, because atelier-html: is more specific than html:.
Without the atelier-html: attribute, the paragraph is dark orange.
The default fallback
default: applies only when no format-specific variant of the same name matched.
::: {default:style="color: grey;" atelier-html:style="color: rebeccapurple;"}
Rebecca purple here, grey everywhere else.
:::Rebecca purple here, grey everywhere else.
In the preview the same construction resolves to the default, since it names no Typst value.
The slide alias
slide: covers revealjs, slidy, s5, dzslides, and slideous at once.
::: {slide:style="font-size: 2em;"}
Larger on every HTML slide format, ordinary here.
:::Larger on every HTML slide format, ordinary here.
Nothing applies on this page, because HTML is not a slide format. An exact prefix beats the alias, so slide: and revealjs: on one element resolve to the second under revealjs and to the first under slidy.
Precedence in one element
::: {style="color: grey;" default:style="color: silver;" atelier-html:style="color: crimson;"}
Crimson here.
:::Crimson here.
The exact match wins, the default is not needed, and the unprefixed style is dropped rather than left to collide, so the element carries one style attribute.
On other elements
It is not only divs.
[An inline span]{atelier-html:style="background: gold;"}
## A heading {atelier-html:style="color: teal;"}An inline span sits in this sentence.
A heading resolved for HTML
A code block takes them too, which is how a listing is shrunk on a slide without touching the code:
```{.r revealjs:style="font-size: 0.6em;"}
1 + 1
```Catching a typo
An unknown prefix is treated as a format that is not active, and the attribute vanishes. With warn-on-drop on, the render says so instead:
(W) [prism] Dropped attribute(s) 'revaeljs:style' on #mybox because no prefix matched target format 'revealjs'.
That is the only way to tell a typo from a deliberately inactive format.
Source
The repository ships a short, standalone starting point you can copy: example.qmd.