Global Layout
layout/theme.liquid is the master HTML shell wrapping every storefront page.
(layout/password.liquid is the equivalent for the password-protected page.)
What theme.liquid renders, in order
<head>
- Charset / viewport meta tags.
css-variables.liquid— inlined first so custom properties exist before any stylesheet applies. See Styles & CSS Variables.base.csspreloaded — design system, typography, layout primitives, reset, accessibility.critical.csspreloaded — critical-path CSS, scroll-lock, section grid.- Font preloading — conditional
preconnectto Shopify’s font CDN and preload of the heading/body font variants (skipped for system fonts). meta-tags.liquid— Open Graph, Twitter cards, canonical.seo-structured-data.liquid— the JSON-LD@graph. See Structured Data.seo-head-extra.liquid— search-engine verification tags + hreflang.global.jsloaded deferred.
<body>
- Body class
color-scheme-1(default; any section can switch its own scheme), plus.anim-onwhen animations are enabled. - A skip-to-content link for accessibility.
{% sections 'header-group' %}— announcement bar + header.<main id="main-content">wrapping{{ content_for_layout }}(the page template).{% sections 'footer-group' %}— footer.- Persistent UI rendered once and reused across pages:
<dialog id="cart-drawer">— the AJAX cart drawer- the quick-view modal
- a back-to-top button
Why persistent UI lives in the layout
The cart drawer and quick-view modal are in the layout (not a template) so they persist across navigation and can be opened from anywhere. They’re refreshed in-place via the Section Rendering API — see JavaScript (global.js).
Related
- Section Groups — how
header-groupandfooter-groupare structured. - Styles & CSS Variables — the
css-variables.liquidtoken system.