:main
Target selector
A pseudo-selector that matches the layer's main fragment.
Use :main to only update the main fragment, while keeping static layout elements around it.
To replace all visible elements of a layer, see :layer.
Targeting the main fragment
You can target the main fragment using the :main selector:
<a href="/cards/5" up-target=":main">Load post</a>
<main>
Post will appear here
</main>
Unpoly will also update :main if no other target is given:
<a href="/cards/5" up-follow>Load post</a>
<main>
Post will appear here
</main>
Also see targeting the main fragment.
Default main targets
The default main targets are:
- any element with an
[up-main]attribute - the HTML5
<main>element - the current layer's topmost swappable element
You may configure main target selectors in up.fragment.config.mainTargets.