Slots and styling
Slots
A slot is one of Truly's components. You place it with a tag; it draws itself:
{% slot 'service_picker' %}
{% slot 'consent', role: 'terms' %}
{% slot 'order', label_da: 'Bestil og betal', label_en: 'Order and pay' %}
Each page has slots it must place, per state: the routes and states reference lists them. The check refuses a package where a template, together with the layout and the snippets they render, never places a slot every state of its page requires, and warns about a slot only some states require. At render, Truly checks the page against the state it is in, so put a state-dependent slot behind the matching drop:
{% slot 'booking_status' %}
{% if state.withdrawal %}{% slot 'withdrawal_notice' %}{% endif %}
{% endslot %}
Container slots
A container slot is a block: Truly draws its container (the step's section, the consents' region, a membership's card) at its place, and your markup and the slots between {% slot %} and {% endslot %} inside it, in your order. The legal parts sit inside their container, so you decide where in the step the consents, the withdrawal notice and the order go:
{% slot 'payment_step' %}
{% if state.open %}
{% slot 'order', label_da: 'Betal nu', label_en: 'Pay now' %}
{% slot 'payment_consents' %}
{% slot 'consent', role: 'perform_now' %}
{% slot 'consent', role: 'terms' %}
{% endslot %}
{% slot 'payment_withdrawal' %}{% if state.withdrawal %}{% slot 'model_withdrawal_form' %}{% endif %}{% endslot %}
{% endif %}
{% endslot %}
Each route's containers, and the slots each holds, are in the routes and states reference. A listed slot outside its container, a container inside one that is not its own, and a container without {% endslot %} fail the check; a slot your snippet places is checked when the page renders. On Min side's membership page the actions sit inside membership_status, which draws them in each membership's card; membership_termination must come before membership_pause.
Rules that hold everywhere:
- The layout places
{% slot 'footer' %}and prints{{ content_for_layout }}once, both at its top level, outside anyif,foror other block and not in a snippet. - Pages where tracking tags may load require
{% slot 'cookie_banner' %}; it is simplest to place it in the layout, where it is allowed on every page. - A slot that is not a container has no content of its own, and no slot can sit inside a link.
- The legal slots (the consents, the withdrawal notice and form, and the order) cannot be replaced or split: the order slot always draws the order summary directly followed by the order button.
The slots reference says what each slot draws.
Styling
Write normal CSS in assets/theme.css, with classes on your elements. Truly rebuilds the stylesheet from what it accepts (see the CSS reference) and serves it from its asset host.
- Your rules apply to your own markup and stop at slots:
button { … }styles your buttons, never Truly's. Your markup inside a container slot is yours again, so your rules reach it and stop at the slots inside it. - Inherited properties do flow into slots:
color,font-family,font-sizeandline-heighton a wrapper style the component inside. - To recolour Truly's components, set the
--truly-…custom properties on your own element around the slots, as in.page { --truly-color-primary: #1a1a1a; --truly-radius: 0; }. The slots reference lists them. - To style inside a component, select its hooks: a rule whose last part is a
[data-part="…"]reaches into the slot, as in.checkout [data-part="order"] { gap: 2rem; }. A part further left ([data-part="order"] button) stays outside. The slots reference lists each slot's hooks; they keep working for themes of the sameformat_version. - No ids, no
:has(), no other attribute selectors and nostyleattributes.
Images and fonts
Put images in assets/ as PNG, JPEG or WebP (no SVG) and show them with <img src="{{ 'hero.webp' | asset_url }}" alt="…">; alt is required (empty for a decorative image). Truly re-encodes them as WebP. The tenant's logos come as drops: <img src="{{ tenant.logo.url }}" alt="{{ tenant.logo.alt }}"> inside {% if tenant.logo %}.
Fonts are WOFF2 files in assets/, loaded with @font-face { font-family: Brand; src: url(brand.woff2) format("woff2"); }. Make sure your licence allows web use.
Icons
Use {% icon 'arrow-right' %} for Truly's icon set; inline SVG is not allowed. The markup reference lists the icons.
Links
Link to the tenant's website with an absolute https: URL, and between Truly's pages with route_url: the route id, then its params written literally in the template. Truly builds the URL (the tenant's domain, the language and campaign parameters).
<a href="{{ 'booking.locations' | route_url }}">All locations</a>
<a href="{{ 'booking.times' | route_url: location: 'norrebro', service: 12 }}">Book a haircut</a>
Each route on the routes page says whether it has a link and which params it takes. A param must match its pattern, or the page fails and falls back:
| Param | Value |
|---|---|
location |
the location's slug in its URL (a-z, 0-9, -) |
service, product, plan |
the service's, punch card's or gift card's, or membership plan's number in its URL |
kind |
the legal text: terms, privacy, … as in its URL |
A missing or extra param, or a route without a link (pages reached only from a link Truly sends, such as a booking's own page, and the error pages), fails the page. In a preview every link opens that route's preview. tel: and mailto: links are not allowed: print phone numbers and email addresses as text.