[{"data":1,"prerenderedAt":2287},["ShallowReactive",2],{"knowledge-routes":3,"en:footer-pages":643,"en:\u002Fshopify\u002Fthemes\u002Fhorizon\u002Flayout-thrashing":656,"en:\u002Fshopify\u002Fthemes\u002Fhorizon\u002Flayout-thrashing:navigation":2255,"en:related:\u002Fshopify\u002Fthemes\u002Fhorizon\u002Fview-transitions,\u002Fshopify\u002Fthemes\u002Fhorizon\u002Fcomponent-base,\u002Fshopify\u002Fthemes\u002Fhorizon\u002Fadd-to-cart-race":2259,"en:graph:\u002Fshopify\u002Fthemes\u002Fhorizon\u002Flayout-thrashing":2266},{"en":4,"zh":32},[5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31],"\u002Fshopify\u002Fshopify-app-boundaries","\u002Fshopify\u002Fshopify-app-distribution","\u002Fshopify\u002Fshopify-app-environment-strategy","\u002Fshopify\u002Fshopify-app-review-access","\u002Fshopify\u002Fshopify-app-usage-billing","\u002Fshopify\u002Fshopify-multiple-apps-shared-backend","\u002Fshopify\u002Fshopify-oauth-redirect-callback","\u002Fshopify\u002Fthemes\u002Fhorizon\u002Fadd-to-cart-race","\u002Fshopify\u002Fthemes\u002Fhorizon\u002Fcomponent-base","\u002Fshopify\u002Fthemes\u002Fhorizon\u002Fkeyed-hydration","\u002Fshopify\u002Fthemes\u002Fhorizon\u002Flayout-thrashing","\u002Fshopify\u002Fthemes\u002Fhorizon\u002Fliquid-smart-contrast","\u002Fshopify\u002Fthemes\u002Fhorizon\u002Fsection-rendering-morph","\u002Fshopify\u002Fthemes\u002Fhorizon\u002Fview-transitions","\u002Fshopify\u002Ftopics\u002Fapps-integrations","\u002Fdomains\u002Facquisition-marketing","\u002Fdomains\u002Fcustomer-service","\u002Fdomains\u002Fdata-analytics","\u002Fdomains\u002Ffinance-compliance","\u002Fdomains\u002Ffulfillment-logistics","\u002Fdomains\u002Fpayments","\u002Fdomains\u002Fplatform-development","\u002Fdomains\u002Fproduct-pricing","\u002Fdomains\u002Fretention","\u002Fdomains\u002Fstorefront-experience","\u002Fjourney\u002Fconvert","\u002Ffunnel\u002Fintent",[33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,5,6,7,8,9,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,10,328,329,11,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,12,387,388,389,390,391,13,392,393,394,14,395,15,16,396,397,398,399,400,401,402,17,403,404,405,18,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,465,466,467,468,469,470,471,472,473,474,475,476,477,478,479,480,481,482,483,484,485,486,487,488,489,490,491,492,493,494,495,496,497,498,499,500,501,502,503,504,505,506,507,508,509,510,511,512,513,514,515,516,517,518,519,520,521,522,523,524,525,526,527,528,529,530,531,532,533,534,535,536,537,538,539,540,541,542,543,544,545,546,547,548,549,550,551,552,553,554,555,556,557,558,559,560,561,562,563,564,565,566,567,568,569,570,571,572,573,574,575,576,577,578,579,580,581,582,583,584,585,586,587,588,589,590,19,591,592,593,594,595,596,597,598,599,600,601,602,603,604,605,606,607,608,609,610,611,612,613,614,615,616,617,618,619,620,621,622,623,624,625,626,627,628,629,630,631,20,21,22,23,24,25,26,27,28,29,632,633,30,634,635,636,637,638,639,640,31,641,642],"\u002Fcommerce\u002Faccessibility-compliance-baseline","\u002Fcommerce\u002Fad-creative-testing","\u002Fcommerce\u002Fapi-authentication","\u002Fcommerce\u002Fapp-distribution-models","\u002Fcommerce\u002Fassortment-planning","\u002Fcommerce\u002Fattribution-basics","\u002Fcommerce\u002Faudiences-remarketing","\u002Fcommerce\u002Fcampaign-formats","\u002Fcommerce\u002Fcheckout-design","\u002Fcommerce\u002Fcheckout-funnel","\u002Fcommerce\u002Fclearance-sales","\u002Fcommerce\u002Fcohort-analysis","\u002Fcommerce\u002Fconsent-and-advertising","\u002Fcommerce\u002Fconsumer-protection-basics","\u002Fcommerce\u002Fcontent-acquisition","\u002Fcommerce\u002Fcontent-localization","\u002Fcommerce\u002Fcontent-repurposing","\u002Fcommerce\u002Fcross-border-basics","\u002Fcommerce\u002Fcustom-data-modeling","\u002Fcommerce\u002Fcustomer-account-access","\u002Fcommerce\u002Fcustomer-data-platform","\u002Fcommerce\u002Fcustomer-demand-validation","\u002Fcommerce\u002Fcustomer-feedback-analysis","\u002Fcommerce\u002Fcustomer-journey-models","\u002Fcommerce\u002Fcustomer-lifecycle-segmentation","\u002Fcommerce\u002Fcustomer-support-channels","\u002Fcommerce\u002Fdata-collection","\u002Fcommerce\u002Fdata-quality","\u002Fcommerce\u002Fdelivery-promise","\u002Fcommerce\u002Fdomain-dns-tls","\u002Fcommerce\u002Fdtc-customer-journey","\u002Fcommerce\u002Femail-sms-marketing","\u002Fcommerce\u002Fenvironments-permissions","\u002Fcommerce\u002Fevent-tracking-plan","\u002Fcommerce\u002Fexperimentation","\u002Fcommerce\u002Fflash-sales","\u002Fcommerce\u002Ffulfillment-delivery","\u002Fcommerce\u002Fgift-with-purchase-bundles","\u002Fcommerce\u002Fgiveaways-contests","\u002Fcommerce\u002Fheadless-commerce","\u002Fcommerce\u002Fidentity-resolution","\u002Fcommerce\u002Finfluencer-collaborations","\u002Fcommerce\u002Finventory-accuracy","\u002Fcommerce\u002Finventory-basics","\u002Fcommerce\u002Finventory-replenishment","\u002Fcommerce\u002Fjourney-stage-alignment","\u002Fcommerce\u002Floyalty-programs","\u002Fcommerce\u002Fmarketing-budget-pacing","\u002Fcommerce\u002Fmarketing-campaign-review","\u002Fcommerce\u002Fmarketing-contact-frequency","\u002Fcommerce\u002Fmarketing-funnel","\u002Fcommerce\u002Fmedia-asset-management","\u002Fcommerce\u002Fmetric-definitions","\u002Fcommerce\u002Forder-event-ad-spend-grain","\u002Fcommerce\u002Forder-unit-economics","\u002Fcommerce\u002Fpaid-acquisition-signals","\u002Fcommerce\u002Fpartial-page-updates","\u002Fcommerce\u002Fpayment-methods","\u002Fcommerce\u002Fpayments-chargebacks","\u002Fcommerce\u002Fpeak-season-campaigns","\u002Fcommerce\u002Fplatform-extension-points","\u002Fcommerce\u002Fpost-purchase-education","\u002Fcommerce\u002Fpre-orders","\u002Fcommerce\u002Fpricing-discounts","\u002Fcommerce\u002Fprivacy-consent-basics","\u002Fcommerce\u002Fproduct-information","\u002Fcommerce\u002Fproduct-launches-drops","\u002Fcommerce\u002Fproduct-search-visibility","\u002Fcommerce\u002Freferral-programs","\u002Fcommerce\u002Frepeat-purchase-retention","\u002Fcommerce\u002Freturns-refunds","\u002Fcommerce\u002Freverse-logistics","\u002Fcommerce\u002Freview-collection","\u002Fcommerce\u002Fsales-channel-publishing","\u002Fcommerce\u002Fsales-tax-vat-basics","\u002Fcommerce\u002Fshipping-rates-strategy","\u002Fcommerce\u002Fstaff-access-control","\u002Fcommerce\u002Fstorefront-component-lifecycle","\u002Fcommerce\u002Fstorefront-design-tokens","\u002Fcommerce\u002Fstorefront-release-validation","\u002Fcommerce\u002Fstorefront-rendering-performance","\u002Fcommerce\u002Fsubscription-commerce","\u002Fcommerce\u002Fthreshold-promotions","\u002Fcommerce\u002Ftransactional-notifications","\u002Fcommerce\u002Furl-redirects","\u002Fcommerce\u002Fusage-based-billing","\u002Fcommerce\u002Fwebhooks","\u002Fcommerce\u002Fwin-back","\u002Fcontent-types\u002Fbrand-story","\u002Fcontent-types\u002Fbrand-values","\u002Fcontent-types\u002Fcore-message","\u002Fcontent-types\u002Fcustomer-reviews","\u002Fcontent-types\u002Fcustomer-testimonials","\u002Fcontent-types\u002Femail-signup","\u002Fcontent-types\u002Ffaq","\u002Fcontent-types\u002Ffeatured-products","\u002Fcontent-types\u002Fguarantee","\u002Fcontent-types\u002Floyalty-rewards","\u002Fcontent-types\u002Fmedia-coverage","\u002Fcontent-types\u002Fpackage-contents","\u002Fcontent-types\u002Fpayment-options","\u002Fcontent-types\u002Fproduct-categories","\u002Fcontent-types\u002Fproduct-overview","\u002Fcontent-types\u002Fproduct-showcase","\u002Fcontent-types\u002Fproduct-specifications","\u002Fcontent-types\u002Fproduct-video","\u002Fcontent-types\u002Fpromotions","\u002Fcontent-types\u002Fproof-metrics","\u002Fcontent-types\u002Frelated-products","\u002Fcontent-types\u002Fresources","\u002Fcontent-types\u002Fshipping-delivery-info","\u002Fcontent-types\u002Fsocial-follow","\u002Fcontent-types\u002Fsupport-contact","\u002Fcontent-types\u002Fthird-party-reviews","\u002Fcontent-types\u002Ftrust-marks","\u002Fcontent-types\u002Ftypes","\u002Fcontent-types\u002Fuser-generated-content","\u002Felevar\u002Fshopify-delivery-chain","\u002Fgoogle-ads\u002Fdynamic-remarketing-feed","\u002Fgoogle-ads\u002Fenhanced-conversions-boundaries","\u002Fgoogle-ads\u002Ftransaction-id-and-reconciliation","\u002Fgoogle-analytics\u002Fcustom-dimensions-and-reconciliation","\u002Fgoogle-analytics\u002Fecommerce-event-mapping","\u002Fgoogle-analytics\u002Fmeasurement-protocol","\u002Fgoogle-analytics\u002Fpage-view-and-spa","\u002Fgoogle-analytics\u002Fproperty-stream-debugging","\u002Fgoogle-merchant-center\u002Fgoogle-ads-linking","\u002Fgoogle-merchant-center\u002Fproduct-feed-review","\u002Fgoogle-tag-manager\u002Fconsent-trigger-troubleshooting","\u002Fgoogle-tag-manager\u002Fcontainers-and-publishing","\u002Fgoogle-tag-manager\u002Fdata-layer-events","\u002Fgoogle-tag-manager\u002Ftag-stack","\u002Fgorgias\u002Fmacros-automation","\u002Fgorgias\u002Ftickets-orders","\u002Fjudge-me\u002Freview-request-scheduling","\u002Fjudge-me\u002Freview-widget-verification","\u002Fklaviyo\u002Fdelivery-unsubscribe-troubleshooting","\u002Fklaviyo\u002Fflow-triggers-and-filters","\u002Fklaviyo\u002Fsubscription-consent-sources","\u002Fmeta-ads\u002Fcustomer-audience-sync","\u002Fmeta-ads\u002Fpixel-capi-event-mapping","\u002Fmeta-ads\u002Fpurchase-event-duplicates","\u002Fmodules\u002Favailability-notification","\u002Fmodules\u002Fbuy-box","\u002Fmodules\u002Fcart-summary","\u002Fmodules\u002Fcollection-browse-filter","\u002Fmodules\u002Fcookie-consent","\u002Fmodules\u002Fcross-sell-upsell","\u002Fmodules\u002Ffit-guidance","\u002Fmodules\u002Fpage-composition","\u002Fmodules\u002Fpatterns","\u002Fmodules\u002Fproduct-selection","\u002Fmodules\u002Fproduct-support-navigation","\u002Fmodules\u002Fpromotion-redemption","\u002Fmodules\u002Freview-display","\u002Fmodules\u002Fsignup-capture","\u002Fmodules\u002Fsite-search","\u002Fmodules\u002Fsocial-proof-strip","\u002Fmodules\u002Fsubscription-terms-summary","\u002Fmodules\u002Fvariant-media-gallery","\u002Fpaypal\u002Fcheckout-disputes","\u002Fpaypal\u002Frefund-not-received","\u002Fpaypal\u002Fsettlement-reconciliation","\u002Fpresentation\u002Faccordion","\u002Fpresentation\u002Fbadge","\u002Fpresentation\u002Fbanner","\u002Fpresentation\u002Fbefore-after","\u002Fpresentation\u002Fcallout","\u002Fpresentation\u002Fcards","\u002Fpresentation\u002Fcarousel","\u002Fpresentation\u002Fcomparison","\u002Fpresentation\u002Fcountdown-timer","\u002Fpresentation\u002Fdrawer","\u002Fpresentation\u002Fempty-state","\u002Fpresentation\u002Fgrid","\u002Fpresentation\u002Fhero","\u002Fpresentation\u002Fhotspot","\u002Fpresentation\u002Finline-form","\u002Fpresentation\u002Flist","\u002Fpresentation\u002Fmarquee","\u002Fpresentation\u002Fmasonry","\u002Fpresentation\u002Fmedia-gallery","\u002Fpresentation\u002Fmodal","\u002Fpresentation\u002Fnavigation-menu","\u002Fpresentation\u002Foverlay","\u002Fpresentation\u002Fpagination","\u002Fpresentation\u002Fpatterns","\u002Fpresentation\u002Fpopover","\u002Fpresentation\u002Fprogress-bar","\u002Fpresentation\u002Frating-stars","\u002Fpresentation\u002Fscroll-reveal","\u002Fpresentation\u002Fsingle-column","\u002Fpresentation\u002Fskeleton-loader","\u002Fpresentation\u002Fsplit","\u002Fpresentation\u002Fstepper","\u002Fpresentation\u002Fsticky-bar","\u002Fpresentation\u002Fswatch","\u002Fpresentation\u002Ftable","\u002Fpresentation\u002Ftabs","\u002Fpresentation\u002Ftimeline","\u002Fpresentation\u002Ftoast","\u002Fregulations\u002Fca-casl","\u002Fregulations\u002Fca-pipeda-consent","\u002Fregulations\u002Feu-accessibility-act","\u002Fregulations\u002Feu-consumer-rights","\u002Fregulations\u002Feu-gdpr-eprivacy-consent","\u002Fregulations\u002Feu-price-reduction-indication","\u002Fregulations\u002Feu-psd2-sca","\u002Fregulations\u002Feu-ucpd-reviews-ranking","\u002Fregulations\u002Feu-vat-oss-ioss","\u002Fregulations\u002Fuk-consumer-contracts","\u002Fregulations\u002Fuk-consumer-rights","\u002Fregulations\u002Fuk-dmcc-reviews-pricing","\u002Fregulations\u002Fuk-gdpr-pecr-consent","\u002Fregulations\u002Fuk-vat-overseas-sellers","\u002Fregulations\u002Fus-can-spam","\u002Fregulations\u002Fus-consumer-reviews-testimonials","\u002Fregulations\u002Fus-endorsement-guides","\u002Fregulations\u002Fus-mail-order-rule","\u002Fregulations\u002Fus-tcpa-text-consent","\u002Fshopify\u002Farticle","\u002Fshopify\u002Farticle\u002Fbuying-guide-article","\u002Fshopify\u002Farticle\u002Fhow-to-article","\u002Fshopify\u002Fblog","\u002Fshopify\u002Fcart","\u002Fshopify\u002Fcollection","\u002Fshopify\u002Fcollection\u002Fcampaign-collection-page","\u002Fshopify\u002Fcollection\u002Fcategory-collection-page","\u002Fshopify\u002Fdawn-vs-horizon","\u002Fshopify\u002Fdiscount-troubleshooting","\u002Fshopify\u002Femail-platform-comparison","\u002Fshopify\u002Fhomepage","\u002Fshopify\u002Finventory-mismatch","\u002Fshopify\u002Flist-collections","\u002Fshopify\u002Forder-analytics-reconciliation","\u002Fshopify\u002Fpage","\u002Fshopify\u002Fpage\u002Fabout-us","\u002Fshopify\u002Fpage\u002Fbrand-story","\u002Fshopify\u002Fpage\u002Fcampaign-landing","\u002Fshopify\u002Fpage\u002Fcontact-us","\u002Fshopify\u002Fpage\u002Ffaq","\u002Fshopify\u002Fpage\u002Fgiveaway","\u002Fshopify\u002Fpage\u002Floyalty-program","\u002Fshopify\u002Fpage\u002Forder-tracking","\u002Fshopify\u002Fpage\u002Fpolicies","\u002Fshopify\u002Fpage\u002Fpress","\u002Fshopify\u002Fpage\u002Freviews","\u002Fshopify\u002Fpage\u002Fshipping-returns","\u002Fshopify\u002Fpage\u002Fsize-guide","\u002Fshopify\u002Fpage\u002Fstore-locator","\u002Fshopify\u002Fpayment-gateway-comparison","\u002Fshopify\u002Fpreorder-delay-troubleshooting","\u002Fshopify\u002Fproduct","\u002Fshopify\u002Fproduct\u002Ffit-sensitive-product-page","\u002Fshopify\u002Fproduct\u002Fpreorder-subscription-page","\u002Fshopify\u002Fproduct\u002Fproduct-drop-page","\u002Fshopify\u002Fproduct\u002Fstandard-product-page","\u002Fshopify\u002Freview-options-comparison","\u002Fshopify\u002Fsearch","\u002Fshopify\u002Fshipping-rate-troubleshooting","\u002Fshopify\u002Fshopify-admin-api-graphql","\u002Fshopify\u002Fshopify-admin-map","\u002Fshopify\u002Fshopify-amount-check","\u002Fshopify\u002Fshopify-analytics-reports","\u002Fshopify\u002Fshopify-b2b","\u002Fshopify\u002Fshopify-bundles","\u002Fshopify\u002Fshopify-checkout-customization","\u002Fshopify\u002Fshopify-collections-publishing","\u002Fshopify\u002Fshopify-custom-data","\u002Fshopify\u002Fshopify-customer-accounts","\u002Fshopify\u002Fshopify-customer-privacy","\u002Fshopify\u002Fshopify-customer-segments","\u002Fshopify\u002Fshopify-discounts","\u002Fshopify\u002Fshopify-domains-dns","\u002Fshopify\u002Fshopify-ecosystem","\u002Fshopify\u002Fshopify-ecosystem-analysis","\u002Fshopify\u002Fshopify-entry-map","\u002Fshopify\u002Fshopify-file-sync-diff","\u002Fshopify\u002Fshopify-files-media","\u002Fshopify\u002Fshopify-flow","\u002Fshopify\u002Fshopify-follow-on-shop","\u002Fshopify\u002Fshopify-fraud-disputes","\u002Fshopify\u002Fshopify-fulfillment-delivery","\u002Fshopify\u002Fshopify-functions-extensions","\u002Fshopify\u002Fshopify-gift-cards","\u002Fshopify\u002Fshopify-headless","\u002Fshopify\u002Fshopify-identities-permissions","\u002Fshopify\u002Fshopify-inventory-locations","\u002Fshopify\u002Fshopify-knowledge-base-method","\u002Fshopify\u002Fshopify-knowledge-source-inventory","\u002Fshopify\u002Fshopify-local-delivery-pickup","\u002Fshopify\u002Fshopify-marketing-channels","\u002Fshopify\u002Fshopify-marketing-messaging","\u002Fshopify\u002Fshopify-markets-shipping","\u002Fshopify\u002Fshopify-multi-currency-pricing","\u002Fshopify\u002Fshopify-navigation-menus","\u002Fshopify\u002Fshopify-notifications-emails","\u002Fshopify\u002Fshopify-online-store-preferences","\u002Fshopify\u002Fshopify-order-payment-status","\u002Fshopify\u002Fshopify-orders-management","\u002Fshopify\u002Fshopify-payments-checkout","\u002Fshopify\u002Fshopify-plans","\u002Fshopify\u002Fshopify-pos","\u002Fshopify\u002Fshopify-product-import-export","\u002Fshopify\u002Fshopify-products-variants","\u002Fshopify\u002Fshopify-purchase-journey","\u002Fshopify\u002Fshopify-purchase-validation","\u002Fshopify\u002Fshopify-returns-refunds","\u002Fshopify\u002Fshopify-sales-channels","\u002Fshopify\u002Fshopify-search-and-discovery","\u002Fshopify\u002Fshopify-selling-plans","\u002Fshopify\u002Fshopify-shipping-rates-labels","\u002Fshopify\u002Fshopify-storefront","\u002Fshopify\u002Fshopify-storefront-performance","\u002Fshopify\u002Fshopify-storefront-seo-framework","\u002Fshopify\u002Fshopify-tagging-options","\u002Fshopify\u002Fshopify-taxes-duties","\u002Fshopify\u002Fshopify-theme-management","\u002Fshopify\u002Fshopify-translation-localization","\u002Fshopify\u002Fshopify-url-redirects","\u002Fshopify\u002Fshopify-verification-priorities","\u002Fshopify\u002Fshopify-web-pixels","\u002Fshopify\u002Fshopify-webhooks-events","\u002Fshopify\u002Fsubscription-app-comparison","\u002Fshopify\u002Ftheme\u002Farchitecture","\u002Fshopify\u002Ftheme\u002Fcapability-modules","\u002Fshopify\u002Ftheme\u002Fcontent-architecture","\u002Fshopify\u002Ftheme\u002Fdecision-patterns-and-states","\u002Fshopify\u002Ftheme\u002Fdelivery-framework","\u002Fshopify\u002Ftheme\u002Fglobal-regions","\u002Fshopify\u002Ftheme\u002Flayout","\u002Fshopify\u002Ftheme\u002Flocales","\u002Fshopify\u002Ftheme\u002Fsettings","\u002Fshopify\u002Ftheme\u002Ftemplates","\u002Fshopify\u002Fthemes\u002Fdawn\u002Faccessibility-patterns","\u002Fshopify\u002Fthemes\u002Fdawn\u002Farchitecture","\u002Fshopify\u002Fthemes\u002Fdawn\u002Fbuy-form-and-availability","\u002Fshopify\u002Fthemes\u002Fdawn\u002Fcart-drawer-notification","\u002Fshopify\u002Fthemes\u002Fdawn\u002Fcolor-schemes","\u002Fshopify\u002Fthemes\u002Fdawn\u002Fcontent-sections-and-animations","\u002Fshopify\u002Fthemes\u002Fdawn\u002Fcountdown-timer","\u002Fshopify\u002Fthemes\u002Fdawn\u002Fcustom-elements-pubsub","\u002Fshopify\u002Fthemes\u002Fdawn\u002Ffacets-and-pagination","\u002Fshopify\u002Fthemes\u002Fdawn\u002Fheader-navigation","\u002Fshopify\u002Fthemes\u002Fdawn\u002Fhtml-update-utility","\u002Fshopify\u002Fthemes\u002Fdawn\u002Floading-performance","\u002Fshopify\u002Fthemes\u002Fdawn\u002Fnewsletter-and-badges","\u002Fshopify\u002Fthemes\u002Fdawn\u002Fpredictive-search","\u002Fshopify\u002Fthemes\u002Fdawn\u002Fproduct-media","\u002Fshopify\u002Fthemes\u002Fdawn\u002Fquantity-input","\u002Fshopify\u002Fthemes\u002Fdawn\u002Frecommendations","\u002Fshopify\u002Fthemes\u002Fdawn\u002Fsection-rendering","\u002Fshopify\u002Fthemes\u002Fdawn\u002Ftheme-editor-events","\u002Fshopify\u002Fthemes\u002Fdawn\u002Fvariant-update-protocol","\u002Fshopify\u002Fthemes\u002Fhorizon\u002Farchitecture","\u002Fshopify\u002Fthemes\u002Fhorizon\u002Fbadges-reviews-signup","\u002Fshopify\u002Fthemes\u002Fhorizon\u002Fbuying","\u002Fshopify\u002Fthemes\u002Fhorizon\u002Fcart","\u002Fshopify\u002Fthemes\u002Fhorizon\u002Fcollection-search","\u002Fshopify\u002Fthemes\u002Fhorizon\u002Fcontent-modules","\u002Fshopify\u002Fthemes\u002Fhorizon\u002Ffacets-and-pagination","\u002Fshopify\u002Fthemes\u002Fhorizon\u002Fheader-navigation","\u002Fshopify\u002Fthemes\u002Fhorizon\u002Flayout","\u002Fshopify\u002Fthemes\u002Fhorizon\u002Fmarquee-slideshow-animations","\u002Fshopify\u002Fthemes\u002Fhorizon\u002Fmedia-zoom-and-hotspots","\u002Fshopify\u002Fthemes\u002Fhorizon\u002Fpredictive-search","\u002Fshopify\u002Fthemes\u002Fhorizon\u002Fproduct-cards","\u002Fshopify\u002Fthemes\u002Fhorizon\u002Fproduct-page","\u002Fshopify\u002Fthemes\u002Fhorizon\u002Freading-source","\u002Fshopify\u002Fthemes\u002Fhorizon\u002Frecommendations","\u002Fshopify\u002Fthemes\u002Fhorizon\u002Fsticky-add-to-cart-and-availability","\u002Fshopify\u002Fthemes\u002Fhorizon\u002Fstyles","\u002Fshopify\u002Fthemes\u002Fhorizon\u002Fvariants","\u002Fshopify\u002Fthemes\u002Fimpact\u002Fbehavior-components","\u002Fshopify\u002Fthemes\u002Fimpact\u002Fcart-events","\u002Fshopify\u002Fthemes\u002Fimpact\u002Fdialog-element","\u002Fshopify\u002Fthemes\u002Fimpact","\u002Fshopify\u002Fthemes\u002Fimpact\u002Flazy-media-player","\u002Fshopify\u002Fthemes\u002Fimpact\u002Fsection-spacing-collapsing","\u002Fshopify\u002Fthemes\u002Fimpact\u002Fvariant-picker-rerender","\u002Fshopify\u002Fthemes","\u002Fshopify\u002Fthemes\u002Fpattern-coverage","\u002Fshopify\u002Fwebhook-delivery-troubleshooting","\u002Ftasks\u002Fadd-product-custom-fields","\u002Ftasks\u002Fanalyse-a-repeat-purchase-cohort","\u002Ftasks\u002Fanalyze-customer-feedback","\u002Ftasks\u002Fanswer-order-status-inquiries","\u002Ftasks\u002Faudit-marketing-contact-pressure","\u002Ftasks\u002Fbuild-a-content-calendar","\u002Ftasks\u002Fcalculate-order-contribution","\u002Ftasks\u002Fcalculate-promotion-margin","\u002Ftasks\u002Fclean-up-a-marketing-list","\u002Ftasks\u002Fcollect-and-display-customer-reviews","\u002Ftasks\u002Fconfigure-sales-tax-or-vat","\u002Ftasks\u002Fconfigure-site-search-and-filters","\u002Ftasks\u002Fdefine-repeat-purchase-metrics","\u002Ftasks\u002Fdesign-loyalty-points-rules","\u002Ftasks\u002Fdiagnose-storefront-performance","\u002Ftasks\u002Fenable-and-test-a-payment-method","\u002Ftasks\u002Fevaluate-and-install-an-app","\u002Ftasks\u002Fhandle-a-delayed-order","\u002Ftasks\u002Fhandle-subscription-pause-and-cancellation","\u002Ftasks\u002Fintegrate-and-verify-a-webhook","\u002Ftasks\u002Flaunch-a-referral-program","\u002Ftasks\u002Fplan-a-discount-campaign","\u002Ftasks\u002Fplan-a-peak-season-campaign","\u002Ftasks\u002Fplan-a-product-assortment","\u002Ftasks\u002Fplan-a-win-back-campaign","\u002Ftasks\u002Fplan-an-ad-creative-test","\u002Ftasks\u002Fplan-inventory-replenishment","\u002Ftasks\u002Fplan-post-purchase-education","\u002Ftasks\u002Fprocess-a-refund","\u002Ftasks\u002Fprocess-returned-goods","\u002Ftasks\u002Fpublish-privacy-notice","\u002Ftasks\u002Freconcile-orders-and-analytics","\u002Ftasks\u002Frespond-to-a-chargeback","\u002Ftasks\u002Frespond-to-a-negative-review","\u002Ftasks\u002Freview-a-marketing-campaign","\u002Ftasks\u002Freview-creator-deliverables","\u002Ftasks\u002Freview-marketing-budget-pacing","\u002Ftasks\u002Freview-product-page-module-order","\u002Ftasks\u002Frun-a-cycle-count","\u002Ftasks\u002Frun-a-giveaway","\u002Ftasks\u002Frun-a-post-purchase-survey","\u002Ftasks\u002Frun-an-accessibility-baseline","\u002Ftasks\u002Fsend-back-in-stock-notifications","\u002Ftasks\u002Fseparate-development-environments","\u002Ftasks\u002Fset-shipping-rates","\u002Ftasks\u002Fset-up-a-pre-order","\u002Ftasks\u002Fset-up-a-welcome-flow","\u002Ftasks\u002Fset-up-conversion-tracking","\u002Ftasks\u002Fset-up-cookie-consent","\u002Ftasks\u002Fset-up-presales-support","\u002Ftasks\u002Ftag-campaign-links","\u002Ftasks\u002Ftest-a-purchase","\u002Ftasks\u002Fvalidate-a-customer-need","\u002Ftasks\u002Fvalidate-audience-sync","\u002Ftasks\u002Fwrite-a-creator-brief","\u002Ftasks\u002Fwrite-a-return-policy","\u002Ftasks\u002Fwrite-an-event-tracking-plan","\u002Ftasks\u002Fwrite-product-use-and-care-guide","\u002Fterms\u002Fabove-the-fold","\u002Fterms\u002Faccess-scope","\u002Fterms\u002Faccessible-rich-internet-applications","\u002Fterms\u002Famericans-with-disabilities-act","\u002Fterms\u002Fapi-versioning","\u002Fterms\u002Fattribution-model","\u002Fterms\u002Fattribution-window","\u002Fterms\u002Faverage-order-value","\u002Fterms\u002Faverage-resolution-time","\u002Fterms\u002Fbackorder","\u002Fterms\u002Fblack-friday-cyber-monday","\u002Fterms\u002Fbreak-even-point","\u002Fterms\u002Fbusiness-to-business","\u002Fterms\u002Fbusiness-to-consumer","\u002Fterms\u002Fbuy-now-pay-later","\u002Fterms\u002Fcall-to-action","\u002Fterms\u002Fcart-abandonment-rate","\u002Fterms\u002Fcash-flow","\u002Fterms\u002Fcash-on-delivery","\u002Fterms\u002Fchargeback","\u002Fterms\u002Fclick-through-rate","\u002Fterms\u002Fcohort","\u002Fterms\u002Fcontent-delivery-network","\u002Fterms\u002Fcontent-security-policy","\u002Fterms\u002Fcontribution-margin","\u002Fterms\u002Fconversion-rate","\u002Fterms\u002Fconversion-rate-optimization","\u002Fterms\u002Fcost-of-goods-sold","\u002Fterms\u002Fcost-per-action","\u002Fterms\u002Fcost-per-click","\u002Fterms\u002Fcost-per-mille","\u002Fterms\u002Fcross-selling","\u002Fterms\u002Fcumulative-layout-shift","\u002Fterms\u002Fcustomer-acquisition-cost","\u002Fterms\u002Fcustomer-churn-rate","\u002Fterms\u002Fcustomer-effort-score","\u002Fterms\u002Fcustomer-lifetime-value","\u002Fterms\u002Fcustomer-relationship-management","\u002Fterms\u002Fcustomer-retention-rate","\u002Fterms\u002Fcustomer-satisfaction-score","\u002Fterms\u002Fdays-of-supply","\u002Fterms\u002Fdelivered-at-place","\u002Fterms\u002Fdelivered-duty-paid","\u002Fterms\u002Fdirect-to-consumer","\u002Fterms\u002Fdomain-name-system-record","\u002Fterms\u002Femail-delivery-rate","\u002Fterms\u002Feuropean-accessibility-act","\u002Fterms\u002Fevent","\u002Fterms\u002Ffeature-flag","\u002Fterms\u002Ffirst-contact-resolution","\u002Fterms\u002Ffirst-response-time","\u002Fterms\u002Fgeneral-data-protection-regulation","\u002Fterms\u002Fglobal-trade-item-number","\u002Fterms\u002Fgross-margin","\u002Fterms\u002Fgross-merchandise-value","\u002Fterms\u002Fgross-profit","\u002Fterms\u002Fharmonized-system-code","\u002Fterms\u002Fhash-based-message-authentication-code","\u002Fterms\u002Fideal-customer-profile","\u002Fterms\u002Fidempotency-key","\u002Fterms\u002Fimport-one-stop-shop","\u002Fterms\u002Finteraction-to-next-paint","\u002Fterms\u002Finventory-record-accuracy","\u002Fterms\u002Flanded-cost","\u002Fterms\u002Flargest-contentful-paint","\u002Fterms\u002Flead-time","\u002Fterms\u002Fminimum-order-quantity","\u002Fterms\u002Fmonth-to-date","\u002Fterms\u002Fmonthly-recurring-revenue","\u002Fterms\u002Fnet-promoter-score","\u002Fterms\u002Fnet-sales","\u002Fterms\u002Foauth-2-authorization-framework","\u002Fterms\u002Fpayment-authorization","\u002Fterms\u002Fpayment-capture","\u002Fterms\u002Fpayment-settlement","\u002Fterms\u002Fpoint-of-sale","\u002Fterms\u002Fpre-order","\u002Fterms\u002Fproduct-bundle","\u002Fterms\u002Fproduct-detail-page","\u002Fterms\u002Fproduct-market-fit","\u002Fterms\u002Fproduct-variant","\u002Fterms\u002Frate-limiting","\u002Fterms\u002Freactivation-rate","\u002Fterms\u002Frecency-frequency-monetary","\u002Fterms\u002Frefund","\u002Fterms\u002Freorder-point","\u002Fterms\u002Frepeat-purchase-rate","\u002Fterms\u002Fresponsive-web-design","\u002Fterms\u002Freturn-on-ad-spend","\u002Fterms\u002Freturn-rate","\u002Fterms\u002Frevenue-per-session","\u002Fterms\u002Fsafety-stock","\u002Fterms\u002Fsearch-engine-marketing","\u002Fterms\u002Fsearch-engine-optimization","\u002Fterms\u002Fsell-through-rate","\u002Fterms\u002Fservice-level-agreement","\u002Fterms\u002Fsession","\u002Fterms\u002Fstaging-environment","\u002Fterms\u002Fstock-keeping-unit","\u002Fterms\u002Fstrong-customer-authentication","\u002Fterms\u002Fsubscription-churn-rate","\u002Fterms\u002Ftelevision-commercial","\u002Fterms\u002Fthird-party-logistics","\u002Fterms\u002Fthree-domain-secure","\u002Fterms\u002Fticket-backlog","\u002Fterms\u002Ftls-certificate","\u002Fterms\u002Funique-selling-proposition","\u002Fterms\u002Funsubscribe-rate","\u002Fterms\u002Fup-selling","\u002Fterms\u002Furchin-tracking-module","\u002Fterms\u002Fuser","\u002Fterms\u002Fuser-generated-content","\u002Fterms\u002Fvalue-added-tax","\u002Fterms\u002Fweb-content-accessibility-guidelines","\u002Fterms\u002Fwebhook","\u002Fwordpress\u002Ftemplates-and-content","\u002Fwordpress\u002Ftheme-json-and-patterns","\u002Fshopify\u002Ftopics\u002Fcustomers","\u002Fshopify\u002Ftopics\u002Fdata-automation","\u002Fshopify\u002Ftopics\u002Fecosystem","\u002Fshopify\u002Ftopics\u002Fofficial-themes","\u002Fshopify\u002Ftopics\u002Fpage-composition-patterns","\u002Fshopify\u002Ftopics\u002Fproducts-content","\u002Fshopify\u002Ftopics\u002Fstore-management","\u002Fshopify\u002Ftopics\u002Fstorefront","\u002Fshopify\u002Ftopics\u002Fstorefront-content-types","\u002Fshopify\u002Ftopics\u002Fstorefront-modules","\u002Fshopify\u002Ftopics\u002Fstorefront-pages","\u002Fshopify\u002Ftopics\u002Ftransactions","\u002Fcommerce\u002Fpaths\u002Fcampaign-planning","\u002Fcommerce\u002Fpaths\u002Fcampaign-tracking","\u002Fcommerce\u002Fpaths\u002Fcommerce-concepts","\u002Fcommerce\u002Fpaths\u002Fcommerce-terms-foundation","\u002Fcommerce\u002Fpaths\u002Fcompliance-baseline","\u002Fcommerce\u002Fpaths\u002Fconsent-and-tracking","\u002Fcommerce\u002Fpaths\u002Fcustomer-demand-validation","\u002Fcommerce\u002Fpaths\u002Fecommerce-tracking-implementation","\u002Fcommerce\u002Fpaths\u002Fmarketing-measurement","\u002Fcommerce\u002Fpaths\u002Forder-unit-economics","\u002Fcommerce\u002Fpaths\u002Fplatform-development-foundations","\u002Fcommerce\u002Fpaths\u002Fplatform-integration-foundations","\u002Fcommerce\u002Fpaths\u002Fpost-purchase-operations","\u002Fcommerce\u002Fpaths\u002Fproduct-to-purchase","\u002Fcommerce\u002Fpaths\u002Frepeat-purchase-cohorts","\u002Fcommerce\u002Fpaths\u002Fretention-operations","\u002Fcommerce\u002Fpaths\u002Fshipping-and-service","\u002Fcommerce\u002Fpaths\u002Ftrustworthy-commerce-data","\u002Fshopify\u002Fpaths\u002Fbuild-your-store","\u002Fshopify\u002Fpaths\u002Fcontent-foundations","\u002Fshopify\u002Fpaths\u002Fdawn","\u002Fshopify\u002Fpaths\u002Fofficial-themes","\u002Fshopify\u002Fpaths\u002Fpage-recipes","\u002Fshopify\u002Fpaths\u002Fplatform-basics","\u002Fshopify\u002Fpaths\u002Fpresentation-accessibility","\u002Fshopify\u002Fpaths\u002Fstorefront-platform-mechanisms","\u002Fshopify\u002Fpaths\u002Ftheme-foundations","\u002Fshopify\u002Fpaths\u002Ftheme-pattern-audit","\u002Fshopify\u002Fpaths\u002Fvalidate-purchase-tracking","\u002Fjourney\u002Fdiscover","\u002Fjourney\u002Fevaluate","\u002Fjourney\u002Frepurchase","\u002Fjourney\u002Fuse","\u002Fjourney\u002Fengage","\u002Fjourney\u002Fdeliver","\u002Ffunnel\u002Fawareness","\u002Ffunnel\u002Finterest","\u002Ffunnel\u002Fconsideration","\u002Ffunnel\u002Fpurchase","\u002Ffunnel\u002Fengage",[644,648,652],{"id":645,"path":646,"title":647},"en_sitePages\u002Fabout.md","\u002Fabout","About WooDawn",{"id":649,"path":650,"title":651},"en_sitePages\u002Flegal\u002Fprivacy.md","\u002Flegal\u002Fprivacy","Privacy Notice",{"id":653,"path":654,"title":655},"en_sitePages\u002Flegal\u002Fterms.md","\u002Flegal\u002Fterms","Content Use Terms",{"document":657,"isArticle":2221},{"id":658,"title":659,"abbreviations":660,"aliases":661,"answers":662,"appliesTo":663,"articleType":664,"body":665,"businessModel":2211,"constrainedBy":2212,"currency":2213,"description":2214,"discussionUrl":663,"domains":2215,"evidenceStatus":2217,"extension":2218,"funnel":2219,"implements":2220,"indexable":2221,"measuredBy":2222,"meta":2223,"metric":663,"navigation":2221,"needs":2224,"originalSources":2225,"path":15,"regions":2226,"related":2227,"reviewAfter":663,"roles":2228,"seo":2230,"seoImage":663,"seoTitle":663,"sources":2231,"stages":2233,"status":2235,"stem":2236,"supersededBy":663,"tags":2237,"term":663,"themeSources":2244,"tools":2248,"updatedAt":2250,"uses":2251,"verification":2252,"verifiedAt":2253,"__hash__":2254},"en_articles\u002Fshopify\u002Fthemes\u002Fhorizon\u002Flayout-thrashing.md","Taming Layout Thrashing in Horizon: On-Demand Measurement, Batched Reads and Writes, Frame-Level Scheduling",[],[],[],null,"guide",{"type":666,"value":667,"toc":2199},"minimark",[668,683,686,691,706,734,741,773,776,799,817,827,898,914,917,921,931,948,1068,1074,1089,1093,1113,1216,1219,1227,1348,1366,1369,1373,1385,1563,1632,1635,1671,1684,1688,1779,1792,1803,1807,1824,2001,2032,2042,2046,2111,2115,2189,2192,2195],[669,670,671,672,682],"p",{},"This article is based on Horizon 4.2.0, with source pinned to ",[673,674,678],"a",{"href":675,"rel":676},"https:\u002F\u002Fgithub.com\u002FShopify\u002Fhorizon\u002Ftree\u002F5acd1b6b66c02f61d3216e3adace5dd9e0404fc9",[677],"nofollow",[679,680,681],"code",{},"5acd1b6"," (verified 2026-10-07). Conclusions are limited to that commit; this is a static source analysis and nothing was tested in a store.",[669,684,685],{},"Layout thrashing is when JS alternates between \"write styles, read sizes,\" with every read forcing the browser to recalculate layout immediately. Horizon has no unified framework for this, but a consistent approach shows up across several files. Here it is organized into seven points.",[687,688,690],"h2",{"id":689},"_1-measure-the-header-before-first-paint-but-only-when-someone-needs-it","1. Measure the header before first paint, but only when someone needs it",[669,692,693,697,698,701,702,705],{},[694,695,696],"strong",{},"Problem",": a few CSS rules depend on the header height at first paint, such as a hero sized to the remaining viewport or a transparent header's negative margin. If measurement waits until ",[679,699,700],{},"header.js"," loads, the first frame uses the 60px fallback from ",[679,703,704],{},"sections\u002Fheader.liquid"," and the content then visibly jumps.",[669,707,708,711,712,717,718,721,722,725,726,729,730,733],{},[694,709,710],{},"Approach",": ",[673,713,716],{"href":714,"rel":715},"https:\u002F\u002Fgithub.com\u002FShopify\u002Fhorizon\u002Fblob\u002F5acd1b6b66c02f61d3216e3adace5dd9e0404fc9\u002Flayout\u002Ftheme.liquid",[677],"layout\u002Ftheme.liquid"," inlines a ",[679,719,720],{},"window.measureHeaderHeights"," function right after the header group, which measures during parsing and writes ",[679,723,724],{},"--header-height"," and ",[679,727,728],{},"--header-group-height"," on ",[679,731,732],{},"body",".",[669,735,736,737,740],{},"But measuring mid-parse forces layout, so the function ",[694,738,739],{},"doesn't run by default","; it's opt-in:",[742,743,744,748],"ul",{},[745,746,747],"li",{},"When the header is transparent, every template needs the values at first paint, so it's called globally right away;",[745,749,750,751,756,757,760,761,764,765,768,769,772],{},"Otherwise, blocks that genuinely depend on the variables at first paint render ",[673,752,755],{"href":753,"rel":754},"https:\u002F\u002Fgithub.com\u002FShopify\u002Fhorizon\u002Fblob\u002F5acd1b6b66c02f61d3216e3adace5dd9e0404fc9\u002Fsnippets\u002Fmeasure-header-heights.liquid",[677],"snippets\u002Fmeasure-header-heights.liquid"," themselves to trigger it. There are currently three: the ",[679,758,759],{},"hero"," section; the ",[679,762,763],{},"_product-details"," block (only when its height is ",[679,766,767],{},"fill","); and the product media gallery (only with ",[679,770,771],{},"constrain_to_viewport",").",[669,774,775],{},"The snippet also offers parameters to narrow the condition, at most one at a time:",[777,778,783],"pre",{"className":779,"code":780,"language":781,"meta":782,"style":782},"language-liquid shiki shiki-themes github-light","{% render 'measure-header-heights', only_when_first_section: true %}\n{% render 'measure-header-heights', only_on_desktop: true %}\n","liquid","",[679,784,785,793],{"__ignoreMap":782},[786,787,790],"span",{"class":788,"line":789},"line",1,[786,791,792],{},"{% render 'measure-header-heights', only_when_first_section: true %}\n",[786,794,796],{"class":788,"line":795},2,[786,797,798],{},"{% render 'measure-header-heights', only_on_desktop: true %}\n",[669,800,801,804,805,808,809,812,813,816],{},[679,802,803],{},"only_when_first_section"," checks whether the section containing ",[679,806,807],{},"document.currentScript"," is the first child of ",[679,810,811],{},"#MainContent",", so only a hero at the very top of the page triggers measurement; ",[679,814,815],{},"only_on_desktop"," only triggers at 750px and up.",[669,818,819,820,823,824,826],{},"Inside, a ",[679,821,822],{},"measured"," flag in a closure ensures it runs only once. After load, ",[679,825,700],{},"'s ResizeObservers take over updating the values.",[777,828,832],{"className":829,"code":830,"language":831,"meta":782,"style":782},"language-mermaid shiki shiki-themes github-light","flowchart TB\n  accTitle: When header height measurement is triggered, narrowed and handed over\n  accDescr: window.measureHeaderHeights does not run by default. With a transparent header it is called globally right away; otherwise blocks that need the variables at first paint render the measure-header-heights snippet, optionally narrowed by a parameter. A closure flag makes it run once, and after load header.js's ResizeObservers take over.\n  fn[\"Inline in theme.liquid:\u003Cbr\u002F>window.measureHeaderHeights\u003Cbr\u002F>does not run by default\"]\n  fn --> q{\"Is the header\u003Cbr\u002F>transparent?\"}\n  q -->|\"Yes: every template\u003Cbr\u002F>needs it at first paint\"| g[\"Called globally right away\"]\n  q -->|No| blk[\"Blocks that need the variables\u003Cbr\u002F>at first paint render\u003Cbr\u002F>measure-header-heights\u003Cbr\u002F>hero section\u003Cbr\u002F>_product-details (only height fill)\u003Cbr\u002F>media gallery (only constrain_to_viewport)\"]\n  blk --> nar[\"Optional narrowing, at most one\u003Cbr\u002F>only_when_first_section:\u003Cbr\u002F>section is first child of #MainContent\u003Cbr\u002F>only_on_desktop: 750px and up\"]\n  g --> once[\"measured flag in closure: runs once\u003Cbr\u002F>writes --header-height and\u003Cbr\u002F>--header-group-height on body\"]\n  nar --> once\n  once --> ro[\"After load, header.js\u003Cbr\u002F>ResizeObservers take over updates\"]\n","mermaid",[679,833,834,839,844,850,856,862,868,874,880,886,892],{"__ignoreMap":782},[786,835,836],{"class":788,"line":789},[786,837,838],{},"flowchart TB\n",[786,840,841],{"class":788,"line":795},[786,842,843],{},"  accTitle: When header height measurement is triggered, narrowed and handed over\n",[786,845,847],{"class":788,"line":846},3,[786,848,849],{},"  accDescr: window.measureHeaderHeights does not run by default. With a transparent header it is called globally right away; otherwise blocks that need the variables at first paint render the measure-header-heights snippet, optionally narrowed by a parameter. A closure flag makes it run once, and after load header.js's ResizeObservers take over.\n",[786,851,853],{"class":788,"line":852},4,[786,854,855],{},"  fn[\"Inline in theme.liquid:\u003Cbr\u002F>window.measureHeaderHeights\u003Cbr\u002F>does not run by default\"]\n",[786,857,859],{"class":788,"line":858},5,[786,860,861],{},"  fn --> q{\"Is the header\u003Cbr\u002F>transparent?\"}\n",[786,863,865],{"class":788,"line":864},6,[786,866,867],{},"  q -->|\"Yes: every template\u003Cbr\u002F>needs it at first paint\"| g[\"Called globally right away\"]\n",[786,869,871],{"class":788,"line":870},7,[786,872,873],{},"  q -->|No| blk[\"Blocks that need the variables\u003Cbr\u002F>at first paint render\u003Cbr\u002F>measure-header-heights\u003Cbr\u002F>hero section\u003Cbr\u002F>_product-details (only height fill)\u003Cbr\u002F>media gallery (only constrain_to_viewport)\"]\n",[786,875,877],{"class":788,"line":876},8,[786,878,879],{},"  blk --> nar[\"Optional narrowing, at most one\u003Cbr\u002F>only_when_first_section:\u003Cbr\u002F>section is first child of #MainContent\u003Cbr\u002F>only_on_desktop: 750px and up\"]\n",[786,881,883],{"class":788,"line":882},9,[786,884,885],{},"  g --> once[\"measured flag in closure: runs once\u003Cbr\u002F>writes --header-height and\u003Cbr\u002F>--header-group-height on body\"]\n",[786,887,889],{"class":788,"line":888},10,[786,890,891],{},"  nar --> once\n",[786,893,895],{"class":788,"line":894},11,[786,896,897],{},"  once --> ro[\"After load, header.js\u003Cbr\u002F>ResizeObservers take over updates\"]\n",[669,899,900,711,903,906,907,725,910,913],{},[694,901,902],{},"The same script has a contrasting case",[679,904,905],{},"--top-row-height"," is only used by header underlays and submenus and isn't needed at first paint. So it's measured inside ",[679,908,909],{},"requestAnimationFrame",[694,911,912],{},"written on the header element rather than on body","; the comment explains that this way the write only invalidates the header subtree.",[669,915,916],{},"Measurement has a cost; when to measure and where to scope the variable should follow from who needs it and when.",[687,918,920],{"id":919},"_2-get-sizes-from-intersectionobserver","2. Get sizes from IntersectionObserver",[669,922,923,926,927,930],{},[679,924,925],{},"getBoundingClientRect()"," forces synchronous layout. An IntersectionObserver callback comes with ",[679,928,929],{},"entry.boundingClientRect",", computed by the browser during its own rendering pipeline, so reading it doesn't trigger extra layout.",[669,932,933,934,937,938,943,944,947],{},"The ",[694,935,936],{},"fly-to-cart animation"," (",[673,939,942],{"href":940,"rel":941},"https:\u002F\u002Fgithub.com\u002FShopify\u002Fhorizon\u002Fblob\u002F5acd1b6b66c02f61d3216e3adace5dd9e0404fc9\u002Fassets\u002Ffly-to-cart.js",[677],"assets\u002Ffly-to-cart.js",") needs the positions of its start (the product image) and end (the cart icon). Instead of calling ",[679,945,946],{},"getBoundingClientRect",", it does:",[777,949,953],{"className":950,"code":951,"language":952,"meta":782,"style":782},"language-js shiki shiki-themes github-light","const io = new IntersectionObserver((entries) => {\n  \u002F\u002F pull the boundingClientRect for source and destination out of entries\n  if (sourceRect && destinationRect) this.#animate(sourceRect, destinationRect);\n  io.disconnect();\n});\nio.observe(this.source);\nio.observe(this.destination);\n","js",[679,954,955,992,998,1023,1034,1039,1055],{"__ignoreMap":782},[786,956,957,961,965,968,971,975,979,983,986,989],{"class":788,"line":789},[786,958,960],{"class":959},"sD7c4","const",[786,962,964],{"class":963},"sYu0t"," io",[786,966,967],{"class":959}," =",[786,969,970],{"class":959}," new",[786,972,974],{"class":973},"s7eDp"," IntersectionObserver",[786,976,978],{"class":977},"sgsFI","((",[786,980,982],{"class":981},"sqxcx","entries",[786,984,985],{"class":977},") ",[786,987,988],{"class":959},"=>",[786,990,991],{"class":977}," {\n",[786,993,994],{"class":788,"line":795},[786,995,997],{"class":996},"sAwPA","  \u002F\u002F pull the boundingClientRect for source and destination out of entries\n",[786,999,1000,1003,1006,1009,1012,1015,1017,1020],{"class":788,"line":846},[786,1001,1002],{"class":959},"  if",[786,1004,1005],{"class":977}," (sourceRect ",[786,1007,1008],{"class":959},"&&",[786,1010,1011],{"class":977}," destinationRect) ",[786,1013,1014],{"class":963},"this",[786,1016,733],{"class":977},[786,1018,1019],{"class":973},"#animate",[786,1021,1022],{"class":977},"(sourceRect, destinationRect);\n",[786,1024,1025,1028,1031],{"class":788,"line":852},[786,1026,1027],{"class":977},"  io.",[786,1029,1030],{"class":973},"disconnect",[786,1032,1033],{"class":977},"();\n",[786,1035,1036],{"class":788,"line":858},[786,1037,1038],{"class":977},"});\n",[786,1040,1041,1044,1047,1050,1052],{"class":788,"line":864},[786,1042,1043],{"class":977},"io.",[786,1045,1046],{"class":973},"observe",[786,1048,1049],{"class":977},"(",[786,1051,1014],{"class":963},[786,1053,1054],{"class":977},".source);\n",[786,1056,1057,1059,1061,1063,1065],{"class":788,"line":870},[786,1058,1043],{"class":977},[786,1060,1046],{"class":973},[786,1062,1049],{"class":977},[786,1064,1014],{"class":963},[786,1066,1067],{"class":977},".destination);\n",[669,1069,1070,1071,1073],{},"After ",[679,1072,1046],{},", the browser delivers an initial callback with the current geometry. It disconnects as soon as it's done.",[669,1075,933,1076,937,1079,1084,1085,1088],{},[694,1077,1078],{},"overflow list",[673,1080,1083],{"href":1081,"rel":1082},"https:\u002F\u002Fgithub.com\u002FShopify\u002Fhorizon\u002Fblob\u002F5acd1b6b66c02f61d3216e3adace5dd9e0404fc9\u002Fassets\u002Foverflow-list.js",[677],"assets\u002Foverflow-list.js",") uses the same technique: it observes the list's first and last items, and when they approach the viewport (",[679,1086,1087],{},"rootMargin"," extended 640px vertically and 360px horizontally), uses the item height from the callback as the list's initial height for the first calculation. The comment puts it as \"get their height from the IntersectionObserver for free (without reflows).\"",[687,1090,1092],{"id":1091},"_3-batch-reads-and-writes","3. Batch reads and writes",[669,1094,1095,1100,1101,1104,1105,1108,1109,1112],{},[673,1096,1099],{"href":1097,"rel":1098},"https:\u002F\u002Fgithub.com\u002FShopify\u002Fhorizon\u002Fblob\u002F5acd1b6b66c02f61d3216e3adace5dd9e0404fc9\u002Fassets\u002Fvariant-picker.js",[677],"assets\u002Fvariant-picker.js"," sets width variables for each option group's \"selected pill\" (",[679,1102,1103],{},"--pill-width-current",", ",[679,1106,1107],{},"--pill-width-previous",") to drive a sliding animation. The code is split into a read-phase method (reading ",[679,1110,1111],{},"offsetWidth",") and a write-phase method (writing CSS variables), and the batch call does all reads first, then all writes:",[777,1114,1116],{"className":950,"code":1115,"language":952,"meta":782,"style":782},"updateVariantPickerCss() {\n  \u002F\u002F Batch all reads first across all fieldsets to avoid layout thrashing\n  const measurements = fieldsets.map((_, i) => this.#getFieldsetMeasurements(i)).filter(Boolean);\n  \u002F\u002F Batch all writes after all reads\n  for (const m of measurements) this.#applyFieldsetMeasurements(m);\n}\n",[679,1117,1118,1126,1131,1178,1183,1211],{"__ignoreMap":782},[786,1119,1120,1123],{"class":788,"line":789},[786,1121,1122],{"class":973},"updateVariantPickerCss",[786,1124,1125],{"class":977},"() {\n",[786,1127,1128],{"class":788,"line":795},[786,1129,1130],{"class":996},"  \u002F\u002F Batch all reads first across all fieldsets to avoid layout thrashing\n",[786,1132,1133,1136,1139,1141,1144,1147,1149,1152,1154,1157,1159,1161,1164,1166,1169,1172,1175],{"class":788,"line":846},[786,1134,1135],{"class":959},"  const",[786,1137,1138],{"class":963}," measurements",[786,1140,967],{"class":959},[786,1142,1143],{"class":977}," fieldsets.",[786,1145,1146],{"class":973},"map",[786,1148,978],{"class":977},[786,1150,1151],{"class":981},"_",[786,1153,1104],{"class":977},[786,1155,1156],{"class":981},"i",[786,1158,985],{"class":977},[786,1160,988],{"class":959},[786,1162,1163],{"class":963}," this",[786,1165,733],{"class":977},[786,1167,1168],{"class":973},"#getFieldsetMeasurements",[786,1170,1171],{"class":977},"(i)).",[786,1173,1174],{"class":973},"filter",[786,1176,1177],{"class":977},"(Boolean);\n",[786,1179,1180],{"class":788,"line":852},[786,1181,1182],{"class":996},"  \u002F\u002F Batch all writes after all reads\n",[786,1184,1185,1188,1190,1192,1195,1198,1201,1203,1205,1208],{"class":788,"line":858},[786,1186,1187],{"class":959},"  for",[786,1189,937],{"class":977},[786,1191,960],{"class":959},[786,1193,1194],{"class":963}," m",[786,1196,1197],{"class":959}," of",[786,1199,1200],{"class":977}," measurements) ",[786,1202,1014],{"class":963},[786,1204,733],{"class":977},[786,1206,1207],{"class":973},"#applyFieldsetMeasurements",[786,1209,1210],{"class":977},"(m);\n",[786,1212,1213],{"class":788,"line":864},[786,1214,1215],{"class":977},"}\n",[669,1217,1218],{},"Done as \"read once, write once\" per group, N option groups could force up to N layouts; batched, it takes one.",[687,1220,1222,1223,1226],{"id":1221},"_4-resizenotifier-skip-the-first-callback","4. ",[679,1224,1225],{},"ResizeNotifier",": skip the first callback",[777,1228,1230],{"className":950,"code":1229,"language":952,"meta":782,"style":782},"export class ResizeNotifier extends ResizeObserver {\n  #initialized = false;\n  constructor(callback) {\n    super((entries) => {\n      if (this.#initialized) return callback(entries, this);\n      this.#initialized = true;\n    });\n  }\n}\n",[679,1231,1232,1251,1264,1277,1292,1318,1334,1339,1344],{"__ignoreMap":782},[786,1233,1234,1237,1240,1243,1246,1249],{"class":788,"line":789},[786,1235,1236],{"class":959},"export",[786,1238,1239],{"class":959}," class",[786,1241,1242],{"class":973}," ResizeNotifier",[786,1244,1245],{"class":959}," extends",[786,1247,1248],{"class":973}," ResizeObserver",[786,1250,991],{"class":977},[786,1252,1253,1256,1258,1261],{"class":788,"line":795},[786,1254,1255],{"class":981},"  #initialized",[786,1257,967],{"class":959},[786,1259,1260],{"class":963}," false",[786,1262,1263],{"class":977},";\n",[786,1265,1266,1269,1271,1274],{"class":788,"line":846},[786,1267,1268],{"class":959},"  constructor",[786,1270,1049],{"class":977},[786,1272,1273],{"class":981},"callback",[786,1275,1276],{"class":977},") {\n",[786,1278,1279,1282,1284,1286,1288,1290],{"class":788,"line":852},[786,1280,1281],{"class":963},"    super",[786,1283,978],{"class":977},[786,1285,982],{"class":981},[786,1287,985],{"class":977},[786,1289,988],{"class":959},[786,1291,991],{"class":977},[786,1293,1294,1297,1299,1301,1304,1307,1310,1313,1315],{"class":788,"line":858},[786,1295,1296],{"class":959},"      if",[786,1298,937],{"class":977},[786,1300,1014],{"class":963},[786,1302,1303],{"class":977},".#initialized) ",[786,1305,1306],{"class":959},"return",[786,1308,1309],{"class":973}," callback",[786,1311,1312],{"class":977},"(entries, ",[786,1314,1014],{"class":963},[786,1316,1317],{"class":977},");\n",[786,1319,1320,1323,1326,1329,1332],{"class":788,"line":864},[786,1321,1322],{"class":963},"      this",[786,1324,1325],{"class":977},".#initialized ",[786,1327,1328],{"class":959},"=",[786,1330,1331],{"class":963}," true",[786,1333,1263],{"class":977},[786,1335,1336],{"class":788,"line":870},[786,1337,1338],{"class":977},"    });\n",[786,1340,1341],{"class":788,"line":876},[786,1342,1343],{"class":977},"  }\n",[786,1345,1346],{"class":788,"line":882},[786,1347,1215],{"class":977},[669,1349,1350,1351,1354,1355,1358,1359,1361,1362,1365],{},"A native ResizeObserver delivers an initial callback after ",[679,1352,1353],{},"observe()",", even if the element's size hasn't changed. Many components have already done their initial layout in ",[679,1356,1357],{},"connectedCallback",", so that first callback is wasted, and the callback usually reads sizes again. ",[679,1360,1225],{}," simply swallows the first callback, and its name says exactly what it means: notify only on real changes. ",[679,1363,1364],{},"disconnect()"," resets the flag, so after observing again the first callback is skipped again. The variant picker and the overflow list both use it.",[669,1367,1368],{},"Note that the flag belongs to the whole observer, not to each element: an element observed after the first batch was swallowed has its initial callback passed through to the component.",[687,1370,1372],{"id":1371},"_5-frame-level-scheduling-merge-tasks-stay-out-of-transitions","5. Frame-level scheduling: merge tasks, stay out of transitions",[669,1374,933,1375,1378,1379,1384],{},[679,1376,1377],{},"Scheduler"," in ",[673,1380,1383],{"href":1381,"rel":1382},"https:\u002F\u002Fgithub.com\u002FShopify\u002Fhorizon\u002Fblob\u002F5acd1b6b66c02f61d3216e3adace5dd9e0404fc9\u002Fassets\u002Futilities.js",[677],"assets\u002Futilities.js",":",[777,1386,1388],{"className":950,"code":1387,"language":952,"meta":782,"style":782},"schedule = async (task) => {\n  this.#queue.add(task);\n  if (!this.#scheduled) {\n    this.#scheduled = true;\n    if (viewTransition.current) await viewTransition.current; \u002F\u002F wait for the in-page transition\n    requestAnimationFrame(this.flush);\n  }\n};\nflush = () => {\n  for (const task of this.#queue) setTimeout(task, 0);\n  this.#queue.clear();\n  this.#scheduled = false;\n};\n",[679,1389,1390,1411,1425,1439,1453,1470,1482,1486,1491,1505,1534,1545,1558],{"__ignoreMap":782},[786,1391,1392,1395,1397,1400,1402,1405,1407,1409],{"class":788,"line":789},[786,1393,1394],{"class":973},"schedule",[786,1396,967],{"class":959},[786,1398,1399],{"class":959}," async",[786,1401,937],{"class":977},[786,1403,1404],{"class":981},"task",[786,1406,985],{"class":977},[786,1408,988],{"class":959},[786,1410,991],{"class":977},[786,1412,1413,1416,1419,1422],{"class":788,"line":795},[786,1414,1415],{"class":963},"  this",[786,1417,1418],{"class":977},".#queue.",[786,1420,1421],{"class":973},"add",[786,1423,1424],{"class":977},"(task);\n",[786,1426,1427,1429,1431,1434,1436],{"class":788,"line":846},[786,1428,1002],{"class":959},[786,1430,937],{"class":977},[786,1432,1433],{"class":959},"!",[786,1435,1014],{"class":963},[786,1437,1438],{"class":977},".#scheduled) {\n",[786,1440,1441,1444,1447,1449,1451],{"class":788,"line":852},[786,1442,1443],{"class":963},"    this",[786,1445,1446],{"class":977},".#scheduled ",[786,1448,1328],{"class":959},[786,1450,1331],{"class":963},[786,1452,1263],{"class":977},[786,1454,1455,1458,1461,1464,1467],{"class":788,"line":858},[786,1456,1457],{"class":959},"    if",[786,1459,1460],{"class":977}," (viewTransition.current) ",[786,1462,1463],{"class":959},"await",[786,1465,1466],{"class":977}," viewTransition.current; ",[786,1468,1469],{"class":996},"\u002F\u002F wait for the in-page transition\n",[786,1471,1472,1475,1477,1479],{"class":788,"line":864},[786,1473,1474],{"class":973},"    requestAnimationFrame",[786,1476,1049],{"class":977},[786,1478,1014],{"class":963},[786,1480,1481],{"class":977},".flush);\n",[786,1483,1484],{"class":788,"line":870},[786,1485,1343],{"class":977},[786,1487,1488],{"class":788,"line":876},[786,1489,1490],{"class":977},"};\n",[786,1492,1493,1496,1498,1501,1503],{"class":788,"line":882},[786,1494,1495],{"class":973},"flush",[786,1497,967],{"class":959},[786,1499,1500],{"class":977}," () ",[786,1502,988],{"class":959},[786,1504,991],{"class":977},[786,1506,1507,1509,1511,1513,1516,1518,1520,1523,1526,1529,1532],{"class":788,"line":888},[786,1508,1187],{"class":959},[786,1510,937],{"class":977},[786,1512,960],{"class":959},[786,1514,1515],{"class":963}," task",[786,1517,1197],{"class":959},[786,1519,1163],{"class":963},[786,1521,1522],{"class":977},".#queue) ",[786,1524,1525],{"class":973},"setTimeout",[786,1527,1528],{"class":977},"(task, ",[786,1530,1531],{"class":963},"0",[786,1533,1317],{"class":977},[786,1535,1536,1538,1540,1543],{"class":788,"line":894},[786,1537,1415],{"class":963},[786,1539,1418],{"class":977},[786,1541,1542],{"class":973},"clear",[786,1544,1033],{"class":977},[786,1546,1548,1550,1552,1554,1556],{"class":788,"line":1547},12,[786,1549,1415],{"class":963},[786,1551,1446],{"class":977},[786,1553,1328],{"class":959},[786,1555,1260],{"class":963},[786,1557,1263],{"class":977},[786,1559,1561],{"class":788,"line":1560},13,[786,1562,1490],{"class":977},[777,1564,1566],{"className":829,"code":1565,"language":831,"meta":782,"style":782},"flowchart TB\n  accTitle: Order of execution in Scheduler schedule and flush\n  accDescr: schedule first adds the task to a Set queue. If a flush is already scheduled it does nothing more; otherwise it sets scheduled, waits for any in-page View Transition to finish, then calls flush via requestAnimationFrame. flush runs setTimeout 0 for every queued task, then clears the queue and resets the flag.\n  s[\"schedule(task)\"] --> add[\"Add to the Set queue\u003Cbr\u002F>same function reference kept once\"]\n  add --> q1{\"Already scheduled?\"}\n  q1 -->|Yes| stay[\"No new scheduling\u003Cbr\u002F>task waits in the queue for flush\"]\n  q1 -->|No| mark[\"scheduled = true\"]\n  mark --> q2{\"viewTransition.current\u003Cbr\u002F>exists?\"}\n  q2 -->|Yes| wait[\"await its completion\"]\n  q2 -->|No| raf[\"requestAnimationFrame(flush)\"]\n  wait --> raf\n  raf --> fl[\"flush: for each queued task\u003Cbr\u002F>setTimeout(task, 0)\"]\n  fl --> clr[\"Clear the queue\u003Cbr\u002F>scheduled = false\"]\n",[679,1567,1568,1572,1577,1582,1587,1592,1597,1602,1607,1612,1617,1622,1627],{"__ignoreMap":782},[786,1569,1570],{"class":788,"line":789},[786,1571,838],{},[786,1573,1574],{"class":788,"line":795},[786,1575,1576],{},"  accTitle: Order of execution in Scheduler schedule and flush\n",[786,1578,1579],{"class":788,"line":846},[786,1580,1581],{},"  accDescr: schedule first adds the task to a Set queue. If a flush is already scheduled it does nothing more; otherwise it sets scheduled, waits for any in-page View Transition to finish, then calls flush via requestAnimationFrame. flush runs setTimeout 0 for every queued task, then clears the queue and resets the flag.\n",[786,1583,1584],{"class":788,"line":852},[786,1585,1586],{},"  s[\"schedule(task)\"] --> add[\"Add to the Set queue\u003Cbr\u002F>same function reference kept once\"]\n",[786,1588,1589],{"class":788,"line":858},[786,1590,1591],{},"  add --> q1{\"Already scheduled?\"}\n",[786,1593,1594],{"class":788,"line":864},[786,1595,1596],{},"  q1 -->|Yes| stay[\"No new scheduling\u003Cbr\u002F>task waits in the queue for flush\"]\n",[786,1598,1599],{"class":788,"line":870},[786,1600,1601],{},"  q1 -->|No| mark[\"scheduled = true\"]\n",[786,1603,1604],{"class":788,"line":876},[786,1605,1606],{},"  mark --> q2{\"viewTransition.current\u003Cbr\u002F>exists?\"}\n",[786,1608,1609],{"class":788,"line":882},[786,1610,1611],{},"  q2 -->|Yes| wait[\"await its completion\"]\n",[786,1613,1614],{"class":788,"line":888},[786,1615,1616],{},"  q2 -->|No| raf[\"requestAnimationFrame(flush)\"]\n",[786,1618,1619],{"class":788,"line":894},[786,1620,1621],{},"  wait --> raf\n",[786,1623,1624],{"class":788,"line":1547},[786,1625,1626],{},"  raf --> fl[\"flush: for each queued task\u003Cbr\u002F>setTimeout(task, 0)\"]\n",[786,1628,1629],{"class":788,"line":1560},[786,1630,1631],{},"  fl --> clr[\"Clear the queue\u003Cbr\u002F>scheduled = false\"]\n",[669,1633,1634],{},"Three details:",[742,1636,1637,1644,1662],{},[745,1638,1639,1640,1643],{},"The queue is a ",[679,1641,1642],{},"Set",", so the same function reference added several times in one scheduling cycle runs once;",[745,1645,1646,1649,1650,1653,1654,1657,1658,1661],{},[694,1647,1648],{},"It waits for the View Transition to finish first."," ",[679,1651,1652],{},"viewTransition.current"," is the ",[679,1655,1656],{},"finished"," promise of the in-page transition (see the in-page section of ",[673,1659,1660],{"href":18},"cross-document View Transitions","). Changing the DOM mid-transition disturbs the snapshots and competes with the animation for the main thread;",[745,1663,1664,1666,1667,1670],{},[679,1665,909],{}," plus ",[679,1668,1669],{},"setTimeout(0)",": align to the next frame first, then run the task after that frame renders. Layout reads in the task happen right after the browser finished layout, so a recalculation usually isn't needed.",[669,1672,1673,1676,1677,1680,1681,733],{},[679,1674,1675],{},"slideshow.js"," uses it to batch reads and writes during initialization and to update each slide's ",[679,1678,1679],{},"aria-hidden"," by visibility. It's also exposed globally as ",[679,1682,1683],{},"Theme.utilities.scheduler",[687,1685,1687],{"id":1686},"_6-yield-to-the-main-thread","6. Yield to the main thread",[777,1689,1691],{"className":950,"code":1690,"language":952,"meta":782,"style":782},"export const yieldToMainThread = () => {\n  if ('yield' in scheduler) return scheduler.yield();\n  return new Promise((resolve) => requestAnimationFrame(() => setTimeout(resolve, 0)));\n};\n",[679,1692,1693,1711,1737,1775],{"__ignoreMap":782},[786,1694,1695,1697,1700,1703,1705,1707,1709],{"class":788,"line":789},[786,1696,1236],{"class":959},[786,1698,1699],{"class":959}," const",[786,1701,1702],{"class":973}," yieldToMainThread",[786,1704,967],{"class":959},[786,1706,1500],{"class":977},[786,1708,988],{"class":959},[786,1710,991],{"class":977},[786,1712,1713,1715,1717,1721,1724,1727,1729,1732,1735],{"class":788,"line":795},[786,1714,1002],{"class":959},[786,1716,937],{"class":977},[786,1718,1720],{"class":1719},"sYBdl","'yield'",[786,1722,1723],{"class":959}," in",[786,1725,1726],{"class":977}," scheduler) ",[786,1728,1306],{"class":959},[786,1730,1731],{"class":977}," scheduler.",[786,1733,1734],{"class":973},"yield",[786,1736,1033],{"class":977},[786,1738,1739,1742,1744,1747,1749,1752,1754,1756,1759,1762,1764,1767,1770,1772],{"class":788,"line":846},[786,1740,1741],{"class":959},"  return",[786,1743,970],{"class":959},[786,1745,1746],{"class":963}," Promise",[786,1748,978],{"class":977},[786,1750,1751],{"class":981},"resolve",[786,1753,985],{"class":977},[786,1755,988],{"class":959},[786,1757,1758],{"class":973}," requestAnimationFrame",[786,1760,1761],{"class":977},"(() ",[786,1763,988],{"class":959},[786,1765,1766],{"class":973}," setTimeout",[786,1768,1769],{"class":977},"(resolve, ",[786,1771,1531],{"class":963},[786,1773,1774],{"class":977},")));\n",[786,1776,1777],{"class":788,"line":852},[786,1778,1490],{"class":977},[669,1780,933,1781,1784,1785,1787,1788,1791],{},[679,1782,1783],{},"scheduler"," here is the browser global, not the ",[679,1786,1377],{}," from the previous section. ",[679,1789,1790],{},"scheduler.yield()"," is preferred: after yielding, the continuation resumes ahead of other queued tasks of the same priority. Without it, it falls back to rAF plus setTimeout.",[669,1793,1794,1795,1798,1799,1802],{},"The variant picker shows a typical use: after a variant switch, the URL is updated with ",[679,1796,1797],{},"history.replaceState",", placed after ",[679,1800,1801],{},"yieldToMainThread()",". The URL update doesn't change what the user sees, so there's no need to cram it into the same task as the click handling; splitting it out helps shorten that interaction's INP.",[687,1804,1806],{"id":1805},"_7-fly-to-cart-compose-the-arc-with-css","7. Fly-to-cart: compose the arc with CSS",[669,1808,1809,1810,1813,1814,1817,1818,1823],{},"The fly-to-cart parabola isn't computed frame by frame in JS. ",[679,1811,1812],{},"fly-to-cart.js"," only writes four CSS variables (start coordinates and travel distances, plus width and height with ",[679,1815,1816],{},"useSourceSize",") and leaves the animation to CSS (",[673,1819,1822],{"href":1820,"rel":1821},"https:\u002F\u002Fgithub.com\u002FShopify\u002Fhorizon\u002Fblob\u002F5acd1b6b66c02f61d3216e3adace5dd9e0404fc9\u002Fsnippets\u002Ffly-to-cart-styles.liquid",[677],"snippets\u002Ffly-to-cart-styles.liquid","):",[777,1825,1829],{"className":1826,"code":1827,"language":1828,"meta":782,"style":782},"language-css shiki shiki-themes github-light","fly-to-cart {\n  translate: var(--start-x, 0) var(--start-y, 0);\n  animation-name: travel-x, travel-y, travel-scale;\n  animation-timing-function: var(--x-timing), var(--y-timing), var(--scale-timing);\n  animation-composition: accumulate;\n}\n@keyframes travel-x { to { translate: var(--travel-x, 0) 0; } }\n@keyframes travel-y { to { translate: 0 var(--travel-y, 0); } }\n","css",[679,1830,1831,1839,1873,1881,1916,1924,1928,1967],{"__ignoreMap":782},[786,1832,1833,1837],{"class":788,"line":789},[786,1834,1836],{"class":1835},"shJU0","fly-to-cart",[786,1838,991],{"class":977},[786,1840,1841,1844,1846,1849,1851,1854,1856,1858,1860,1862,1864,1867,1869,1871],{"class":788,"line":795},[786,1842,1843],{"class":963},"  translate",[786,1845,711],{"class":977},[786,1847,1848],{"class":963},"var",[786,1850,1049],{"class":977},[786,1852,1853],{"class":981},"--start-x",[786,1855,1104],{"class":977},[786,1857,1531],{"class":963},[786,1859,985],{"class":977},[786,1861,1848],{"class":963},[786,1863,1049],{"class":977},[786,1865,1866],{"class":981},"--start-y",[786,1868,1104],{"class":977},[786,1870,1531],{"class":963},[786,1872,1317],{"class":977},[786,1874,1875,1878],{"class":788,"line":846},[786,1876,1877],{"class":963},"  animation-name",[786,1879,1880],{"class":977},": travel-x, travel-y, travel-scale;\n",[786,1882,1883,1886,1888,1890,1892,1895,1898,1900,1902,1905,1907,1909,1911,1914],{"class":788,"line":852},[786,1884,1885],{"class":963},"  animation-timing-function",[786,1887,711],{"class":977},[786,1889,1848],{"class":963},[786,1891,1049],{"class":977},[786,1893,1894],{"class":981},"--x-timing",[786,1896,1897],{"class":977},"), ",[786,1899,1848],{"class":963},[786,1901,1049],{"class":977},[786,1903,1904],{"class":981},"--y-timing",[786,1906,1897],{"class":977},[786,1908,1848],{"class":963},[786,1910,1049],{"class":977},[786,1912,1913],{"class":981},"--scale-timing",[786,1915,1317],{"class":977},[786,1917,1918,1921],{"class":788,"line":858},[786,1919,1920],{"class":963},"  animation-composition",[786,1922,1923],{"class":977},": accumulate;\n",[786,1925,1926],{"class":788,"line":864},[786,1927,1215],{"class":977},[786,1929,1930,1933,1936,1939,1942,1944,1947,1949,1951,1953,1956,1958,1960,1962,1964],{"class":788,"line":870},[786,1931,1932],{"class":959},"@keyframes",[786,1934,1935],{"class":981}," travel-x",[786,1937,1938],{"class":977}," { ",[786,1940,1941],{"class":973},"to",[786,1943,1938],{"class":977},[786,1945,1946],{"class":963},"translate",[786,1948,711],{"class":977},[786,1950,1848],{"class":963},[786,1952,1049],{"class":977},[786,1954,1955],{"class":981},"--travel-x",[786,1957,1104],{"class":977},[786,1959,1531],{"class":963},[786,1961,985],{"class":977},[786,1963,1531],{"class":963},[786,1965,1966],{"class":977},"; } }\n",[786,1968,1969,1971,1974,1976,1978,1980,1982,1984,1986,1989,1991,1994,1996,1998],{"class":788,"line":876},[786,1970,1932],{"class":959},[786,1972,1973],{"class":981}," travel-y",[786,1975,1938],{"class":977},[786,1977,1941],{"class":973},[786,1979,1938],{"class":977},[786,1981,1946],{"class":963},[786,1983,711],{"class":977},[786,1985,1531],{"class":963},[786,1987,1988],{"class":963}," var",[786,1990,1049],{"class":977},[786,1992,1993],{"class":981},"--travel-y",[786,1995,1104],{"class":977},[786,1997,1531],{"class":963},[786,1999,2000],{"class":977},"); } }\n",[669,2002,2003,2004,2007,2008,2011,2012,2015,2016,2019,2020,2023,2024,2027,2028,2031],{},"Horizontal and vertical movement are ",[694,2005,2006],{},"two independent animations",", each with its own ",[679,2009,2010],{},"cubic-bezier",", stacked onto the start position via ",[679,2013,2014],{},"animation-composition: accumulate",". For the main product form, the X curve has a large negative control point (",[679,2017,2018],{},"cubic-bezier(0.7, -5, 0.98, 0.5)","), so it first pulls back the other way and then accelerates toward the target; the Y curve rises quickly at first and then eases. Combined, they form an arc that backs off first and then is flung toward the cart. The main form (",[679,2021,2022],{},"--main","), quick add (",[679,2025,2026],{},"--quick",") and sticky add-to-cart (",[679,2029,2030],{},"--sticky",") mainly differ in their easing curves and durations.",[669,2033,2034,2035,2037,2038,2041],{},"After writing the variables, JS first calls ",[679,2036,1801],{},", then waits for all of ",[679,2039,2040],{},"this.getAnimations()"," to finish before removing the element, with no timer guessing at the animation length.",[687,2043,2045],{"id":2044},"things-worth-questioning","Things worth questioning",[742,2047,2048,2061,2078,2093],{},[745,2049,2050,2056,2057,2060],{},[694,2051,2052,2053,733],{},"There are two copies of ",[679,2054,2055],{},"calculateHeaderGroupHeight"," The inline script and ",[679,2058,2059],{},"utilities.js"," each implement it, with a \"keep them in sync\" comment. As with the View Transitions detection logic, it's the price of inline scripts being unable to import modules.",[745,2062,2063,2066,2067,2070,2071,2073,2074,2077],{},[694,2064,2065],{},"Each overflow-list reflow still forces one layout."," IntersectionObserver only saves it the initial height measurement. The real layout calculation moves the \"More\" button to the front with ",[679,2068,2069],{},"order: -1"," and enables wrapping, then reads ",[679,2072,946],{}," for it and for every item; items whose ",[679,2075,2076],{},"top"," is greater than the \"More\" button's have been pushed to a second row. Writes come first and reads after, so a single reflow forces only one layout, but it has to be redone on every size or child change. The idea itself is clever: let the browser's flex wrapping answer \"does it fit?\"",[745,2079,2080,1649,2089,2092],{},[694,2081,2082,2085,2086,2088],{},[679,2083,2084],{},"overflow-list.js"," defines a ",[679,2087,1394],{}," getter but never uses it.",[679,2090,2091],{},"#handleChange"," writes rAF plus setTimeout directly. It looks like a leftover from a refactor.",[745,2094,2095,2100,2101,2103,2104,2107,2108,2110],{},[694,2096,2097,2098,733],{},"The measurement snippet declares a top-level ",[679,2099,960],{}," The inline script for ",[679,2102,803],{}," uses ",[679,2105,2106],{},"const section = ...",". A top-level ",[679,2109,960],{}," in a classic script goes into the global lexical scope shared by all scripts, so when a page has two hero sections, the second script throws on redeclaration and doesn't run. The second hero isn't the first section anyway, so it's functionally harmless, but it adds a console error and could collide with another script's global of the same name. This is a static inference from JS semantics, not reproduced in a browser.",[687,2112,2114],{"id":2113},"summary","Summary",[2116,2117,2118,2131],"table",{},[2119,2120,2121],"thead",{},[2122,2123,2124,2128],"tr",{},[2125,2126,2127],"th",{},"Technique",[2125,2129,2130],{},"Problem it solves",[2132,2133,2134,2143,2151,2159,2166,2173,2181],"tbody",{},[2122,2135,2136,2140],{},[2137,2138,2139],"td",{},"On-demand pre-paint measurement",[2137,2141,2142],{},"First-paint content jumps, without making every page pay for measurement",[2122,2144,2145,2148],{},[2137,2146,2147],{},"Sizes from IntersectionObserver",[2137,2149,2150],{},"Avoids forced layout when reading positions once",[2122,2152,2153,2156],{},[2137,2154,2155],{},"Batched reads and writes",[2137,2157,2158],{},"Avoids N forced layouts during batch updates",[2122,2160,2161,2163],{},[2137,2162,1225],{},[2137,2164,2165],{},"Drops the pointless initial callback",[2122,2167,2168,2170],{},[2137,2169,1377],{},[2137,2171,2172],{},"Dedupes within a cycle, avoids transitions, runs after layout",[2122,2174,2175,2178],{},[2137,2176,2177],{},"yieldToMainThread",[2137,2179,2180],{},"Splits long tasks to improve INP",[2122,2182,2183,2186],{},[2137,2184,2185],{},"CSS animation composition",[2137,2187,2188],{},"Complex trajectories without per-frame JS",[669,2190,2191],{},"None of these techniques is new, but Horizon applies them in the right places, mostly with comments explaining why, and they're worth reading alongside the source.",[669,2193,2194],{},"Horizon's LICENSE.md forbids distributing themes derived from its code; this article only analyzes the source, so implement any borrowed ideas yourself.",[2196,2197,2198],"style",{},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .sD7c4, html code.shiki .sD7c4{--shiki-default:#D73A49}html pre.shiki code .sYu0t, html code.shiki .sYu0t{--shiki-default:#005CC5}html pre.shiki code .s7eDp, html code.shiki .s7eDp{--shiki-default:#6F42C1}html pre.shiki code .sgsFI, html code.shiki .sgsFI{--shiki-default:#24292E}html pre.shiki code .sqxcx, html code.shiki .sqxcx{--shiki-default:#E36209}html pre.shiki code .sAwPA, html code.shiki .sAwPA{--shiki-default:#6A737D}html pre.shiki code .sYBdl, html code.shiki .sYBdl{--shiki-default:#032F62}html pre.shiki code .shJU0, html code.shiki .shJU0{--shiki-default:#22863A}",{"title":782,"searchDepth":795,"depth":795,"links":2200},[2201,2202,2203,2204,2206,2207,2208,2209,2210],{"id":689,"depth":795,"text":690},{"id":919,"depth":795,"text":920},{"id":1091,"depth":795,"text":1092},{"id":1221,"depth":795,"text":2205},"4. ResizeNotifier: skip the first callback",{"id":1371,"depth":795,"text":1372},{"id":1686,"depth":795,"text":1687},{"id":1805,"depth":795,"text":1806},{"id":2044,"depth":795,"text":2045},{"id":2113,"depth":795,"text":2114},"dtc",[],"historical","A set of techniques from the Horizon 4.2.0 source for avoiding forced synchronous layout: measuring header heights before first paint only when needed, getting sizes from IntersectionObserver, batching reads and writes in the variant picker, a ResizeNotifier that skips the first callback, a Scheduler that waits for transitions, yielding to the main thread, and composing the fly-to-cart arc with CSS animations.",[2216],"storefront-experience","partial","md",[],[],true,[],{},[],[],[],[18,13,12],[2229],"developer",{"title":659,"description":2214},[714,753,940,1820,1081,1097,1381,2232],"https:\u002F\u002Fgithub.com\u002FShopify\u002Fhorizon\u002Fblob\u002F5acd1b6b66c02f61d3216e3adace5dd9e0404fc9\u002Fassets\u002Fslideshow.js",[2234],"cross-cutting","published","shopify\u002Fthemes\u002Fhorizon\u002Flayout-thrashing",[2238,2239,2240,2241,2242,2243],"Horizon","Shopify","Source analysis","4.2.0","Performance","Layout thrashing",[2245],{"theme":2246,"version":2247,"url":675},"horizon","4.2.0 · 5acd1b6b66c02f61d3216e3adace5dd9e0404fc9",[2249],"shopify","2026-10-19",[],"Static reading of layout\u002Ftheme.liquid, snippets\u002Fmeasure-header-heights.liquid and its callers, assets\u002Ffly-to-cart.js, snippets\u002Ffly-to-cart-styles.liquid, assets\u002Foverflow-list.js, assets\u002Fvariant-picker.js, assets\u002Futilities.js and assets\u002Fslideshow.js at Horizon 4.2.0 commit 5acd1b6. No store, theme editor or browser testing and no performance profiling; effects on CLS and INP were not measured.","2026-10-07","3VHke6lF7l_TJYvb0awy-qHw3TYSomFsdbD0TgPS9Q8",{"topic":2256,"paths":2258},{"title":2257,"path":29},"Storefront and experience",[],[2260,2262,2264],{"title":2261,"path":18},"Horizon's Cross-Document View Transitions: Render Blocking, Bail-Out Conditions and a WebView Blocklist",{"title":2263,"path":13},"Horizon's Web Components Base Class: Refs, on: Event Delegation, and the Upgrade Race",{"title":2265,"path":12},"Horizon's Add-to-Cart Race Handling: Clicking Add While a Variant Switch Is Still Pending",{"titles":2267,"toolNames":2268,"domainPaths":2281,"reverse":2282},{},{"elevar":2269,"google-ads":2270,"google-analytics":2271,"google-merchant-center":2272,"google-tag-manager":2273,"gorgias":2274,"judge-me":2275,"klaviyo":2276,"meta-ads":2277,"paypal":2278,"shopify":2239,"woocommerce":2279,"wordpress":2280},"Elevar","Google Ads","Google Analytics","Google Merchant Center","Google Tag Manager","Gorgias","Judge.me","Klaviyo","Meta Ads","PayPal","WooCommerce","WordPress",[20,21,22,23,24,25,26,27,28,29],{"implements":2283,"measuredBy":2284,"needs":2285,"constrainedBy":2286},[],[],[],[],1792741304721]