To build a custom Shopify theme, start by deciding whether an existing theme can be adapted, then design the sections merchants will actually use, build templates in Liquid, and test for speed, accessibility and editor usability before handover. Most stores do not need a theme written from nothing, but some genuinely do.
This guide walks through the theme build itself: the starting-point decision, design, structure, Liquid, performance, accessibility, testing and the handover that lets a merchant run the store without a developer.
Customise an existing theme or build from scratch?
Customise an existing theme when your needs are close to what it already does, and build from scratch when your design, content model or performance goals fight the theme at every step. The right answer depends on how much of the theme you would end up replacing.
When customising an existing theme makes sense
Shopify’s own themes and well-maintained third-party themes already solve a lot of hard problems: responsive layouts, cart behaviour, accessibility basics, and compatibility with the theme editor. If your store needs a distinct look, a few new sections and some template changes, adapting one of these themes is faster and carries less risk.
This route also keeps you close to the theme’s update path. A theme that is still maintained by its authors will receive fixes and platform changes that you would otherwise have to write yourself. Check Shopify’s current documentation for how theme updates and customisations interact before you commit.
When building from scratch makes sense
A scratch build earns its cost in a few situations:
- The design is unusual enough that overriding an existing theme means fighting its markup and styles.
- The catalogue has a content structure the stock templates cannot express, such as products with several distinct page types.
- The existing theme carries years of unused code, apps and scripts that slow the storefront and are hard to remove safely.
- The team wants full control over the code base, with its own conventions and tooling.
Even then, “from scratch” rarely means a blank folder. Most teams begin from Shopify’s reference theme, which provides a working structure to learn from or fork. Check Shopify’s current documentation for the recommended starting point today.
A practical decision test
Ask three questions. How many templates and sections would you have to rewrite? How often will the design change after launch? And who will maintain the code in a year? If the honest answer to the first is “most of them”, a custom build is justified. If the design will change often and the team is small, a flexible customised theme may serve better.
If the store is large or has complicated requirements, a Shopify development partner can help you assess the options before you spend anything.
Start with design, not code
A good theme build begins with the design system and the content model. Writing Liquid before you know what the pages need leads to rework and brittle templates.
Define the page types and the sections
List every page type the store needs: home page, collection, product, cart, blog, article, search, plus any custom pages. For each one, write down the blocks of content that appear on it. Those blocks become your sections.
Think in reusable units. A hero banner, a featured collection row, an image with text, a testimonial strip and a rich text block can appear on many pages. Building each as a flexible section means merchants can assemble pages themselves.
Set up design tokens
Decide colours, type scales, spacing, button styles and form styles once, and expose them as settings and variables. Shopify themes let you define theme settings that merchants change in the editor. Keeping tokens in one place makes a rebrand a settings change rather than a code change.
Design for the real content
Layouts that look perfect with polished sample images often break with real data. Plan for long product titles, missing images, products with many variants, and collections with very few items. A solid UI/UX design process tests these edge cases in the design stage, when they are cheap to fix.
Understand the theme structure
A Shopify theme is a set of files organised by purpose. Knowing what each folder does makes the build far easier to reason about. Check Shopify’s current documentation for the exact folder layout, since it evolves.
The main building blocks
- Layout files wrap every page. They hold the document head, header, footer and the place where page content is inserted.
- Templates define what each page type contains. Modern themes use JSON templates that list which sections appear and in what order.
- Sections are the reusable, configurable blocks of a page. Each one has its own markup, styles, settings and optional repeatable blocks.
- Snippets are small reusable fragments, such as a product card or an icon, that sections and templates can include.
- Assets hold stylesheets, scripts and images.
- Config and locales hold theme settings and translated text.
Why JSON templates matter
JSON templates separate the structure of a page from its code. A merchant can add, remove and reorder sections without a developer touching a file. That is the main reason modern themes feel flexible, and it should shape every decision you make about how sections are built.
Liquid and templates at a conceptual level
Liquid is the templating language that turns store data into HTML. You do not need to memorise syntax to understand how it works. You need to understand the flow of data into markup.
How Liquid thinks
Shopify exposes objects such as the current product, collection, cart and shop. Liquid lets you output their properties, loop over lists, and apply conditions. Filters transform values, for example formatting an image URL or a date.
A template asks, in effect: given this product, what should the page show? The section answers by combining the product data with its own settings and markup.
Keep logic light
Liquid is best at presentation. Heavy calculations, deeply nested loops and repeated lookups make pages slower and harder to read. Where logic is needed, keep it near the top of a section, give variables clear names, and avoid repeating the same lookup in several places.
Sections, blocks and settings
Each section declares a schema that describes the settings a merchant can change and the block types they can add. Good schema design is part of the product you are delivering. Use clear labels, sensible defaults and grouped settings so that a merchant understands each option without guidance.
Dynamic data and metafields
Many custom themes need content that the standard product fields do not hold, such as care instructions, size guides or ingredient lists. Shopify’s custom data features let you store this content and surface it in sections. Plan these fields early, because they affect both the admin experience and the template design. Check Shopify’s current documentation for the supported data types and how themes connect to them.
Working with apps
Apps often inject their own scripts and markup. Decide in advance which functions the theme will handle natively and which will depend on apps. Fewer third-party scripts generally mean a faster, more predictable storefront. Where an app is necessary, check whether it supports the theme editor’s app block approach rather than requiring manual code edits.
Build for performance from the start
Performance is easier to build in than to retrofit. A theme that is light by design gives every page a head start. For a deeper look at speed work on a live store, see our guide to Shopify store speed optimization.
Keep the front end lean
- Load only the scripts and styles a page needs rather than shipping everything everywhere.
- Prefer native browser features and plain CSS over heavy libraries when they do the job.
- Defer non-critical scripts so the page can render first.
- Avoid large blocks of unused code inherited from older themes.
Handle images carefully
Images are usually the heaviest part of a storefront. Use Shopify’s image tools to serve appropriately sized versions, provide responsive sizes, and lazy load images below the fold. Always set dimensions so the layout does not jump while images load. Give the main image on a page priority so it appears quickly. Check Shopify’s current documentation for the recommended image filters and attributes.
Fonts and third-party code
Custom fonts can delay text rendering if loaded carelessly. Limit the number of families and weights, and use font display settings that show text promptly. Audit every third-party script for its real value, since each one adds work for the browser.
Measure as you build
Test performance on realistic pages during development, not only at the end. Tools such as Lighthouse and Shopify’s own theme checking tools can flag problems early. Treat the results as guidance, and compare behaviour on real mid-range phones, not only on a fast development machine.
Make accessibility part of the build
An accessible theme works for more customers and avoids legal and reputational risk. It is much cheaper to build in than to repair later.
Use semantic markup
Use real headings in a logical order, real buttons for actions and real links for navigation. Landmarks such as header, main and footer help screen reader users move around. Avoid using generic containers for interactive elements.
Keyboard and focus behaviour
Everything a mouse user can do should work from the keyboard. That includes menus, product galleries, quantity selectors, filters and the cart drawer. Keep a clear visible focus style, move focus sensibly when dialogs open and close, and never trap a keyboard user.
Colour, text and media
Check colour contrast for text, buttons and form fields, including in any colour schemes merchants can choose. Provide meaningful alt text fields for images, and make sure the theme does not rely on colour alone to convey information. Ensure that text can be resized without breaking the layout.
Forms and feedback
Label every form field, connect error messages to the fields they describe, and announce cart updates to assistive technology. Test with a screen reader at least once on the key purchase path. Check the current Web Content Accessibility Guidelines and any regional requirements that apply to your store.
Test the theme thoroughly
Testing should cover function, appearance, content variety and the editing experience. A theme that passes only on the developer’s machine is not finished.
A testing checklist
- Devices and browsers: test on common phones, tablets and desktop browsers, including older versions your customers still use.
- Purchase flow: add to cart, change quantities, apply discounts, check out, and confirm the whole path works.
- Product variety: products with one variant, many variants, no image, very long names, and sold-out states.
- Collections: empty collections, large collections, filtering and sorting.
- Content edge cases: missing fields, long text, right to left languages if relevant, and translated content.
- Markets and currencies: if the store sells internationally, confirm that localised content and formatting behave properly.
Use a development workflow
Work on an unpublished theme copy or a development store, and use version control so changes are tracked and reversible. Shopify’s command line tools support local development and syncing with a store. Check Shopify’s current documentation for the supported tooling and Git integration. Keep a staging theme for final review before anything goes live.
Review the code
Run Shopify’s theme checking tool and have a second developer review the work. Look for unused code, inconsistent naming, hard-coded text that should be translatable, and settings without clear labels.
Design for theme editor friendliness
A theme succeeds when the people running the store can use it. Editor friendliness is not a finishing touch. It shapes how you build every section.
Give merchants safe flexibility
Let merchants change what they will need to change: text, images, links, colours, layout options and section order. Avoid hard-coding content that will change. At the same time, avoid exposing so many options that they can break the design. A short list of well-chosen settings beats a long list of rarely used ones.
Make the editor preview accurate
Sections should render properly inside the theme editor, including when empty. Provide placeholder content so that a newly added section looks sensible before a merchant fills it in. Make sure sections reload correctly as settings change.
Write for non-developers
Use plain labels and short helper text. Group related settings, and give sensible default values. Name sections by what they do, not by internal code names.
Plan the handover
A theme build is not complete until the store owner can operate it. Handover turns a project into a working asset.
What to deliver
- Documentation: a clear guide to the sections available, how to use them, and how to add new pages.
- Training: a walkthrough for the people who will edit content day to day.
- Code documentation: notes for future developers on structure, conventions and any unusual decisions.
- Access and ownership: the repository, theme files and any assets in accounts the store owner controls.
- A maintenance plan: who handles bug fixes, platform changes and new features after launch.
Plan for the long term
Platform features change over time, and a theme needs periodic attention. Agree in advance how updates will be handled and how new requirements will be scoped. If your roadmap includes a decoupled front end later, our article on whether headless Shopify is worth it explains when that move makes sense. For wider custom work beyond the theme, see Shopify custom development.
If you want help scoping a theme project, you can contact the team to discuss your store.
Frequently asked questions
Do I need to build a Shopify theme from scratch?
Usually not. Adapting a well-maintained existing theme is faster and lower risk when your needs are close to what it offers. A scratch build makes sense when the design, content structure or performance goals conflict with every available theme.
What skills are needed to build a custom Shopify theme?
You need HTML, CSS and JavaScript, plus an understanding of Liquid and the theme file structure. Design skills, accessibility knowledge and familiarity with the theme editor also matter. Check Shopify's current documentation for the tooling it supports.
What is Liquid?
Liquid is Shopify's templating language. It takes store data such as products, collections and the cart, and turns it into the HTML a customer sees. It handles presentation and simple logic, not heavy processing.
How do I make a theme easy for merchants to edit?
Build content as flexible sections with clear settings, sensible defaults and placeholder content. Use JSON templates so merchants can reorder sections, and avoid hard-coding text that will change.
How do I keep a custom theme fast?
Keep scripts and styles lean, serve appropriately sized images, limit fonts and third-party code, and test on realistic devices throughout the build rather than only at the end.
Can I test a theme without affecting my live store?
Yes. Work on an unpublished theme copy or a development store, and preview it before publishing. Using version control adds a safe way to track and reverse changes.
What should be included in a theme handover?
Documentation for merchants, training for editors, notes for future developers, ownership of the code and assets, and a plan for ongoing maintenance and updates.
Have a project in mind? Let’s talk it through.
Tell us what you’re building. The first conversation is free, and you’ll leave with a clear next step.
Start your project













