Clicks & Carts

How to build a Shopify theme from scratch

The minimum files Shopify needs, the order to build in — and an honest answer about when starting from an empty folder is a mistake.

8 min read · Themes & storefront ·

You can build a Shopify theme from an empty folder, and it's a genuinely useful exercise because it forces you to understand what the platform actually requires. Whether you should start a client project that way is a different question, and the honest answer is usually no.

The minimum viable theme

Shopify will render a store from a surprisingly small set of files:

`` layout/theme.liquid templates/index.json templates/product.json templates/collection.json templates/cart.liquid templates/page.json templates/404.liquid templates/list-collections.json templates/search.json templates/blog.json templates/article.json sections/ (one per section referenced above) config/settings_schema.json locales/en.default.json ``

layout/theme.liquid must contain {{ content_for_header }} and {{ content_for_layout }}. Without them the store doesn't work — the file structure covers why.

Add customer account templates if you're using classic accounts, and a password template if the store will ever be locked.

The order to build in

Building in this order means you always have something that renders:

  1. theme.liquid — the shell, with the required objects, a font strategy and one stylesheet.
  2. A product template. The hardest and most important page. Start here rather than the homepage, because it forces the decisions about data and layout that everything else inherits. Product page anatomy covers what it needs.
  3. A collection template with a product card snippet you'll reuse. Collection pages and filtering.
  4. Cart.
  5. Homepage as a set of sections. It's the most visible page and the least structurally demanding — which is why building it first is a trap.
  6. The rest — search, pages, blog, 404.
  7. Settings and schema, once you know what actually varies. Theme settings.
  8. Locales — extract every string as you go, not at the end. Retrofitting is miserable.

What you're taking on

Building from scratch means you own things a base theme gives you free:

  • Accessibility. Focus management, keyboard operation, ARIA on the cart and menus, contrast. Non-trivial to get right and easy to get subtly wrong.
  • The cart and variant JavaScript. Add to cart, variant switching, quantity updates, cart drawer, error states.
  • Predictive search.
  • Responsive image handling at the quality Shopify's own themes ship with.
  • App compatibility. App blocks need somewhere to render.
  • Edge cases. Sold-out variants, products with one variant, collections with no products, carts with a discount, gift cards.

That's weeks of work reproducing solved problems, and every one of them is a place to introduce a bug that a mature base theme doesn't have.

When from-scratch is actually right

  • Learning. Build one. You'll understand every theme you touch afterwards.
  • A storefront so unusual that a conventional theme structure fights you at every turn — and you've genuinely checked that's true rather than assumed it.
  • Extreme performance requirements where you need to control every byte, and you've already established that tuning a good theme isn't enough.
  • A design system that must be shared with other properties, where the theme is one consumer of it.

Outside those, starting from Dawn gets you a sound architecture, an accessibility baseline and ongoing upstream improvements, and you spend your budget on what makes the store specific rather than on rebuilding a cart.

If you do start from scratch

Three rules that keep it maintainable:

  1. Structure it like a normal theme. Don't invent a folder layout. The next developer needs to recognise it.
  2. Build sections properly from the first one. Schema, presets, block.shopify_attributes, sensible defaults — see sections and blocks.
  3. Use the CLI and version control from commit one. The CLI workflow.

And build performance in as you go, because it can't be added later — the checklist.

Building a theme from scratch is the best way to learn Shopify and usually the wrong way to bill a client. The skill is knowing which situation you're in.

Is this the problem you’re looking at?

Send me the link to your store and a line about what is going wrong. You get a straight answer within one business day — no pitch, no obligation.

mario@clicksandcarts.co

Or see what I do around Shopify: services, work beyond the theme, selected work.

Keep reading

← All articles