The sale hero and bundle block rendered from the real Liquid files: a countdown to one absolute time, then the saving worked out from the actual prices.
Liquid additions to a Dawn-based Shopify theme on a dev store, plus a measured performance diagnosis. The additions fix gaps the stock theme leaves open.
Proof: theme check reports 0 offenses on the sale sections' own files. The countdown tests pass 22 of 22, the Liquid tests 25 of 25 and the spec table tests 7 of 7. The planted-defect suites catch 15 of 15 and 23 of 23 (countdown and spec table runs on 2026-10-12, Liquid run on 2026-12-01, table in docs/sale-sections.md). The bundle button's tests pass 24 of 24 and catch 25 of 25 planted defects, and the same flows pass 9 of 9 against the development store in Edge (2026-12-01, docs/bundle-cart-api.md).
Store: dac-dev-store.myshopify.com (development store, password-protected).
It was checked with Shopify's own theme check (default configuration) and pushed with the Shopify CLI. The stock theme has its own offenses, and the older breadcrumb snippet reports one (details in docs/verification.md).
Static copy of the sale sections that you can open without the store password: https://sale-sections-preview.pages.dev/
The page Claude wrote is at /source there.
A Dawn-based Shopify theme leaves gaps. The theme emits no BreadcrumbList structured data. A technical catalogue needs a specification table that adds a spec without a theme change. A sale page written outside the theme cannot be pasted into it.
This repo holds those additions as Online Store 2.0 pieces that read the theme's own settings. It also holds a Lighthouse diagnosis of a public storefront that points at third-party scripts rather than image compression. The reference pages below hold the detail, the measured figures and the bugs found on the way.
design-source/winter-sale.html is a landing page written by Claude (October 2026) as the stand-in for a design handed over. It is one HTML file with hex colours, English
baked in, and a script that runs on DOMContentLoaded. It cannot be pasted into a theme. This repo holds its conversion
into editable Online Store 2.0 pieces, and a list of what had to change and why (docs/CONVERSION.md).
| Piece | File |
|---|---|
| Sale hero with a countdown, editable in the theme editor | sections/sale-event-hero.liquid, assets/section-sale-event-hero.css, assets/sale-countdown.js |
| "What is in the bundle" block for a real bundle product, saving worked out from the real prices | sections/bundle-contents.liquid, assets/section-bundle-contents.css |
| A sale landing page and a sale collection template | templates/page.sale-landing.json, templates/collection.sale-event.json |
| Design intent, colour and token mapping, rules to keep | DESIGN.md |
| Dev-store data: bundle product, smart collection, page, metafields, a discount ending when the countdown does | scripts/seed_sale_demo.py |
The sections take their colours from the theme's colour schemes and end the countdown at one absolute instant. They handle a re-render through a custom element. They keep the bundle as its own product with its own price. The full behaviour list with the trade-offs is in docs/sale-sections.md.
The bundle block's add to cart button used to post a form, which reloads the page. assets/bundle-add-to-cart.js is a <bundle-add-to-cart> custom element written like sale-countdown.js. It sends one POST /cart/add.js with a JSON items body (the bundle line, with a property listing what it includes), which is Shopify's AJAX Cart API. A 422 (sold out, or all of the stock already in the cart) is shown next to the button. After a successful add it sends GET /cart?sections=cart-icon-bubble,cart-drawer, which is the Section Rendering API, parses the returned HTML and replaces only the header cart count and the cart drawer's inner panel.
It locks the button while the add is in flight, aborts an older refresh when a newer one starts, and removes its listener and aborts its request when the theme editor removes it. Without JavaScript the form still posts to /cart/add. Running it on the development store found two things the stand-in had hidden: /cart?sections= answers with the cart's own JSON when the request asks for JSON, and a 422 from /cart/add.js can still be a partial add, so the cart is redrawn after a refused add too. Both are fixed and each has a test. The behaviour list, how it was tested and what was not tested are in docs/bundle-cart-api.md.
legacy-theme/ is a pre Online Store 2.0 theme: Shopify's open Timber framework at tag v2.2.2 (MIT) with the bundle block and its button ported in the legacy way. Its templates are .liquid files, templates/page.sale-landing.liquid places the sections with {% section %}, and their settings are in config/settings_data.json. The header cart link became a section so the Section Rendering API can redraw it, and a cart summary section stands in for the drawer, which Timber builds in the browser. The script changed only in its table of section targets.
Debut's repository answers 404, so there was no tag to pin. The tests pass 29 of 29 and catch 37 of 37 planted defects. The pushed unpublished theme legacy-timber-demo passed the same flows 8 of 8 in Edge, and the first live run found a bug the stand-in had hidden (item.properties.size behaved as false on the store), now fixed and tested. What changed, what a legacy theme cannot do, the theme lists before and after, and what was not tested (other legacy themes, the theme editor, Shopify's theme store, a live shop) are in docs/legacy-theme.md.
| Piece | What it does | Reference |
|---|---|---|
snippets/seo-breadcrumb-jsonld.liquid |
BreadcrumbList structured data, which the theme emits nowhere, with absolute URLs from request.origin and every value through | json |
docs/seo-and-spec-table.md |
sections/product-spec-table.liquid |
A metafield-driven specification table, so adding a spec needs no theme change, with the specs reaching the theme's own Product node | docs/seo-and-spec-table.md |
perf/app-cost.mjs, perf/audit.mjs |
Third-party cost per origin, and Lighthouse median-of-N against a password-gated dev store | docs/performance.md |
| The original diagnosis | Lighthouse mobile on a public storefront: performance score 39, LCP 43.0 s, TBT 870 ms, 500 requests, 5,921 KB; two thirds of the weight is third-party | docs/performance.md |
Reference pages:
- docs/bundle-cart-api.md: the bundle button's AJAX Cart API add and Section Rendering API refresh, how it was tested and what was not
- docs/legacy-theme.md: the legacy theme port, what changed and how it was checked
- docs/sale-sections.md: what the sale sections do, the check table and what the Liquid tests are and are not
- docs/storefront-and-preview.md: the check on the real storefront and theme editor, and the static preview build
- docs/overlay-and-own-theme.md: which stock Dawn files are tracked and how to use the sections in your own theme
- docs/seo-and-spec-table.md: the breadcrumb snippet, the spec table and the five product pages the layout came from
- docs/performance.md:
perf/tooling, what was tried and thrown away, and the original diagnosis - docs/cro-review.md: the sale page reviewed against conversion rate optimization practice, and which checks a development store covers
- docs/verification.md:
theme checkoffense counts, earlier browser checks and why a linter is not a validator - docs/STORE_CHECK.md and docs/CONVERSION.md: the real-store record with screenshots, and what changed in the conversion
The repo is an overlay on Shopify's stock Dawn theme. Most stock files are git-ignored on purpose (see .gitignore). The sale sections are two Liquid sections (sections/sale-event-hero.liquid, sections/bundle-contents.liquid) with one CSS file each, two scripts (assets/sale-countdown.js, a <sale-countdown> custom element, and assets/bundle-add-to-cart.js, a <bundle-add-to-cart> one) and two templates. scripts/seed_sale_demo.py seeds the dev store. tests/ holds the Chromium and LiquidJS suites, perf/ the measurement scripts and preview/ the static copy, legacy-theme/ a second, legacy theme. The tracked stock or edited files and the copy list are in docs/overlay-and-own-theme.md.
You need the Shopify CLI and a dev store for the push. You also need Node 20 or newer for the tests and the preview (Playwright 1.64). Node 20.19 or newer is needed for npm run css (Sass), and Node 22.19 or newer for perf/audit.mjs (Lighthouse). Python 3 is needed only for the seed script and perf/read_report.py.
shopify theme check
shopify theme push --unpublished
npm install
npx playwright install chromium
npm run previewnpm run preview renders both sections from the real files, fed with the dev store's own product titles, prices and images read from its public Storefront API. It screenshots them at 390px and 1280px. It needs the stock Dawn files this repo overlays, so run it from a checkout of Shopify's Dawn v9.0.0 or earlier with this repo's files copied over it. Setup and token variables are in docs/storefront-and-preview.md. To try the sale sections in your own Dawn-based theme, copy only the files listed in docs/overlay-and-own-theme.md and merge the sections.sale_event_hero and sections.bundle_contents keys into your own locale file. scripts/seed_sale_demo.py seeds the author's development store only. It refuses any other shop.
npm test
npm run test:mutants
npm run test:liquid
npm run test:liquid-mutants
npm run test:spec
npm run test:cart
npm run test:cart-mutants
npm run test:legacy
npm run test:legacy-mutantsThe tests need Playwright (npm install, then npx playwright install chromium). Figures from runs on 2026-10-12:
| Check | Result |
|---|---|
shopify theme check --output json, filtered to the sale sections' own files |
0 offenses |
node tests/countdown.test.cjs: Chromium with a controlled clock |
22 of 22 |
node tests/countdown_mutants.cjs: planted defects |
15 of 15 caught |
node tests/liquid.test.cjs: the real section Liquid executed through LiquidJS with Shopify's objects stubbed |
25 of 25 (20 on 2026-10-12, 5 added 2026-12-01 for the bundle button's attributes) |
node tests/liquid_mutants.cjs: planted defects in the Liquid |
23 of 23 caught (16 on 2026-10-12, 7 added 2026-12-01) |
node tests/bundle_cart.test.cjs (npm run test:cart): the real section and script in Chromium against a stand-in storefront (2026-12-01) |
24 of 24 |
node tests/bundle_cart_mutants.cjs (npm run test:cart-mutants): planted defects in the script and the Liquid (2026-12-01) |
25 of 25 caught |
node tests/live_bundle_cart.cjs: the same flows in Edge against the development store, not in CI because it needs the storefront password and an Admin token (2026-12-01) |
9 of 9 |
node tests/live_mutants.cjs: four planted defects served to the live page |
4 of 4 caught |
node tests/legacy_bundle_cart.test.cjs (npm run test:legacy): the legacy theme's real template, sections and script in Chromium against a stand-in storefront (2026-12-01) |
29 of 29 |
node tests/legacy_mutants.cjs (npm run test:legacy-mutants): planted defects in a copy of the legacy theme (2026-12-01) |
37 of 37 caught |
shopify theme check on legacy-theme/ (node scripts/theme_check_summary.cjs legacy-theme) |
207 offenses in the whole theme (138 are stock Timber's), 0 in the files this repo wrote |
node tests/live_legacy_theme.cjs: the pushed unpublished theme legacy-timber-demo in Edge, not in CI because it needs the storefront password (2026-12-01) |
8 of 8, and 3 of 3 planted defects caught |
node tests/spec_table.test.cjs (npm run test:spec): the older spec table through LiquidJS |
7 of 7 |
docs/sale-sections.md covers what each case does, the bug the spec table test found and what the stand-in for Shopify's renderer cannot prove. The theme check offense counts for the whole theme are in docs/verification.md.
What comes next:
- Build and save a page by hand in the editor.
- Take the sale through Shopify's hosted checkout page (the discount was read from a real cart).
- Support bundle quantities beyond one part.
- Price every variant of a multi-variant bundle (today it prices the first available one).
Two limits of the hero (the typed-time zone picker's five fixed offsets, and the contrast of the accent-2 and background-2 colour schemes) are written up in docs/sale-sections.md. Locale keys exist in English for the new sections.
The performance figures are lab figures under Lighthouse's mobile preset. The app-cost figures are an upper bound. Both caveats are in docs/performance.md.
Liquid on Shopify's Dawn theme and on Timber (a legacy theme), the Shopify CLI and theme check, JavaScript tests on Node with Playwright and LiquidJS, Sass, Lighthouse, and Python 3 for the seed script.
This repository is an overlay on Shopify's stock Dawn theme. That is MIT with Shopify's added condition that it is used to develop themes that work with Shopify. The full text is in LICENSE, next to the MIT licence of my additions. legacy-theme/ is Shopify's Timber (MIT), with its licence in legacy-theme/LICENSE.



