Help
Custom code
How to change code safely and keep your changes through updates.
Changing theme code isn't covered by support. An update copies your code edits only when they don't clash with the new version (see Update), so keep a copy of what you changed. Before you edit code, duplicate the theme (Online Store → Themes → … → Duplicate) and work on the copy. For larger changes, hire a Shopify Partner: shopify.com/partners/directory.
For small styling changes, prefer the Custom Liquid section and block, or Theme settings → Custom CSS, which carry over to new versions.

Theme settings → Custom CSS
For developers: JavaScript events
The theme fires these events so apps and custom code can react without editing theme files. Listen with document.addEventListener('cart:updated', (event) => { … }).
| Event | Fired on | When | event.detail |
|---|---|---|---|
cart:updated | document | After any add, change or update through the theme, including the cart drawer, quick add and cart page | The cart object from Shopify's Cart API (items, item_count, total_price and more) |
cart:error | document | When adding to the cart fails, for example when stock runs out | { button, message }: the add button and Shopify's error message |
collection:updated | document | After filtering, sorting, "Load more" or infinite scroll changes the products in a collection or search grid | { added }: how many products were added or are now shown |
overlay:open | the drawer or dialog (bubbles) | When a drawer, quick view, search or other overlay opens | none |
overlay:close | the drawer or dialog (bubbles) | When it closes | none |
fit-profile:changed | document | When a shopper saves their result in the fit finder | The saved profile, for example activity, support and summary |
variant:change | document | When the shopper picks another variant on a product page, a featured product or in quick view (not for the variant the page opened with) | { variant, sectionId, productUrl }: the variant (id, price, available, sku, options and more, or null for a combination that doesn't exist) |
product:variant | the product block (bubbles) | Each time a product block settles on a variant, including when it first loads | { variant } |
newsletter:subscribed | the sign-up form (bubbles) | After a newsletter sign-up succeeds | none |
endurance:ready | document | Once the theme's script has run and window.Endurance (cart helpers below) is ready. Scripts loading later can check window.Endurance?.ready instead | { endurance } |
Cart helpers
window.Endurance.cart uses the same requests as the theme, so the drawer, counters and rewards bar update for you:
Endurance.cart.add([{ id: variantId, quantity: 1 }])adds items and refreshes the cart.Endurance.cart.change(lineKey, quantity)changes one line. Use0to remove it.Endurance.cart.refresh()re-renders the cart after an app changed it some other way.
If an app adds to the cart with its own request, call Endurance.cart.refresh() afterwards so the drawer and the cart count show the change.
Custom CSS
Theme settings → Custom CSS applies to the whole store, and each section has its own Custom CSS field at the bottom of its settings, which applies to that section only. Shopify limits how long these fields can be; for longer code, add a Custom Liquid section with a <style> tag. Custom CSS stays when you update the theme, but class names inside sections can change between versions, so prefer the variables below where you can.
The theme's look comes from CSS variables you can reuse or override:
| Variable | What it holds |
|---|---|
--font-heading, --font-body, --font-label | The three font families from Theme settings → Typography |
--font-heading-weight, --font-body-weight | Their weights |
--t-display, --t-h1 to --t-h4, --t-sub, --t-body, --t-small, --t-label | Text sizes |
--bg, --fg, --muted, --accent, --accent-fg, --surface, --line | Colors of the current color scheme |
--r-button, --r-card, --r-box | Corner radii |
--page-width, --gutter, --section-gap | Page width, side margin and the space between sections |
For example, .section { --accent: #0b6e4f; } in a section's Custom CSS changes that section's accent color only.
Your own font
Theme settings offer Shopify's font library. To use a font you've bought or made yourself, you need a little code:
- Duplicate the theme and work on the copy.
- Upload the font files, preferably
.woff2, in Content → Files and copy each file's link. - In Theme settings → Custom CSS, add an
@font-facerule for each weight you upload, then set the font on the parts you want, for exampleh1, h2, h3 { font-family: 'Your Font', sans-serif; }.
Upload only the weights you use, and check that your font license allows use on a website. If the font doesn't show, compare the font name in both rules (it must match exactly) and open the store in a private window.
Send us a screenshot and your store link. We reply within two business days.