Shopify Theme Development: How to Build a Custom Theme Using Liquid

Shopify Theme Development is an essential skill for developers who want to create unique, flexible, and high-performing eCommerce websites. While Shopify provides many ready-made themes, businesses often need more control over their store’s design, layout, and functionality. Building a custom Shopify theme using Liquid allows developers to create personalized shopping experiences that match specific business requirements and brand identities.

Shopify uses Liquid, its powerful templating language, to connect store data with the storefront. By combining Liquid with HTML, CSS, JavaScript, and JSON templates, developers can build dynamic website layouts, customize product pages, create reusable sections, and implement advanced theme features.

Whether you are a beginner learning Shopify development or an experienced developer looking to build a custom storefront, understanding Shopify theme architecture and Liquid is important. A well-developed theme should not only look attractive but also provide flexibility, mobile responsiveness, fast loading times, and an excellent user experience.

In this complete guide, you’ll learn how to build a custom Shopify theme using Liquid, starting with the development environment and theme structure. We’ll explore Shopify CLI, Liquid syntax, templates, sections, blocks, snippets, theme settings, and practical coding examples. You’ll also discover how to test, optimize, and publish your custom Shopify theme.

What Is Shopify Theme Development?

Shopify Theme Development is the process of creating, customizing, and maintaining the visual design and functionality of a Shopify online store.

A Shopify theme controls how different pages and store elements appear to customers. This includes the homepage, product pages, collection pages, shopping cart, navigation menus, footer, and other storefront components.

Developers can either customize an existing Shopify theme or build a completely new theme from scratch. While existing themes provide a starting point, custom theme development offers greater flexibility when a business requires unique layouts or specialized functionality.

Shopify themes are built using several technologies:

  • Liquid: Handles dynamic store data and template logic.
  • HTML: Defines the structure of website content.
  • CSS: Controls styling, colors, spacing, and responsive layouts.
  • JavaScript: Adds interactive functionality and dynamic behavior.
  • JSON: Defines templates, settings, and theme configurations.

These technologies work together to create a complete Shopify storefront.

Why Build a Custom Shopify Theme Using Liquid?

A ready-made Shopify theme can work well for many businesses, but it may not provide every feature or design option a store needs. Custom theme development gives developers more control over the website’s structure, appearance, and functionality.

Here are some important benefits of building a custom Shopify theme.

1. Complete Design Flexibility

A custom theme allows you to create a unique website design instead of relying entirely on predefined theme layouts.

You can customize the homepage, product pages, collection layouts, navigation, promotional banners, and other website elements according to your brand requirements.

2. Better Control Over Functionality

Custom development makes it possible to implement specific features that may not be available in standard theme settings.

For example, you can create custom product information tabs, advanced product badges, unique promotional sections, dynamic content blocks, and specialized shopping experiences.

3. Improved Store Performance

A carefully developed custom theme can avoid unnecessary features, scripts, and design components that your business does not need.

By keeping the code organized and loading only the required resources, developers can improve website performance.

However, custom development alone does not guarantee a faster website. Image optimization, JavaScript execution, third-party apps, and hosting-related factors also affect performance.

4. Easier Future Customization

A well-structured theme makes future updates and maintenance easier.

Using reusable sections, blocks, and snippets allows developers to update individual components without repeatedly modifying the same code.

5. Better Brand Identity

Custom themes help businesses create a consistent visual experience across their websites.

You can control typography, colors, layouts, product presentation, and interactive elements to match your brand identity.

Understanding Shopify Theme Architecture

Before building a custom Shopify theme, you should understand how Shopify organizes theme files.

Modern Shopify themes follow a structured directory system. Each folder has a specific purpose, and understanding this architecture makes development more organized.

A typical Shopify theme includes the following directories:

my-custom-theme/
│
├── assets/
│   ├── base.css
│   ├── theme.js
│   └── images/
│
├── blocks/
│
├── config/
│   ├── settings_schema.json
│   └── settings_data.json
│
├── layout/
│   └── theme.liquid
│
├── locales/
│   └── en.default.json
│
├── sections/
│   ├── header.liquid
│   ├── footer.liquid
│   ├── image-banner.liquid
│   └── featured-collection.liquid
│
├── snippets/
│   ├── product-card.liquid
│   └── price.liquid
│
└── templates/
    ├── index.json
    ├── product.json
    ├── collection.json
    ├── page.json
    └── cart.json

Let’s understand the purpose of each directory.

Assets

The assets folder stores the files required for your theme’s presentation and functionality.

It commonly contains:

  • CSS stylesheets
  • JavaScript files
  • Images
  • Fonts
  • Other static resources

You can reference theme assets using Shopify’s Liquid filters.

Example:

{{ 'base.css' | asset_url | stylesheet_tag }}

This generates the appropriate stylesheet reference for the theme asset.

Blocks

The blocks directory contains reusable theme blocks that can be used across supported sections.

Theme blocks allow developers to create flexible content components that merchants can add, remove, configure, and sometimes nest within other blocks.

Config

The config folder contains theme configuration files.

For example, settings_schema.json defines global theme settings that appear in the Shopify Theme Editor, while settings_data.json stores the theme’s configuration data.

Layout

The layout folder contains the main layout files that provide the overall structure of your website.

The most important file is theme.liquid. It usually contains the HTML document structure, header and footer section groups, and the main content output.

Locales

The locales folder contains translation files used to support multiple languages.

These files help developers create themes that can display localized text and provide translated content.

Sections

Sections are reusable components that make it possible to customize different parts of a Shopify store.

Examples include:

  • Image banners
  • Featured collections
  • Product grids
  • Testimonials
  • Newsletter forms
  • Promotional content

Snippets

Snippets contain reusable pieces of Liquid and HTML code.

For example, product cards, price displays, icons, and small content components can be stored as snippets and reused throughout the theme.

Templates

Templates control the structure and content of different page types.

Common templates include product, collection, homepage, blog, article, cart, and standard page templates.

Shopify’s modern Online Store 2.0 architecture uses JSON templates to arrange sections dynamically.

Step 1: Set Up Your Shopify Theme Development Environment

Before writing Liquid code, you need to prepare your development environment.

Shopify provides Shopify CLI, a command-line tool that helps developers create, preview, test, and publish Shopify themes.

Required Tools

You will generally need:

  • A Shopify account or development store.
  • Shopify CLI.
  • Node.js, where required by the CLI installation method.
  • A code editor such as Visual Studio Code.
  • Basic knowledge of HTML, CSS, JavaScript, and Liquid.
  • Appropriate permission to access the Shopify store.

You can install Shopify CLI by following Shopify’s official installation documentation.

After installation, open your terminal and check that the CLI is available:

shopify version

This command displays the installed Shopify CLI version.

Create a New Shopify Theme

Shopify provides a theme initialization command that helps you start a new theme project.

Run:

shopify theme init

Follow the prompts to create your theme project using Shopify’s Skeleton reference theme.

After initialization, enter the project directory:

cd my-custom-theme

You now have a starting structure for your custom theme.

Connect Your Theme to a Shopify Store

To preview your theme using actual store data, run:

shopify theme dev --store your-store.myshopify.com

Replace your-store with your actual Shopify store domain.

Shopify CLI creates a development theme and provides a preview URL. You can view your changes while working on your local theme files.

One major advantage of this workflow is that CSS and section changes can be previewed with automatic updates.

Step 2: Understand the Main Layout File

The theme.liquid file is one of the most important files in a Shopify theme.

It provides the main HTML structure shared across different pages.

A simplified layout looks like this:

<!doctype html>
<html lang="{{ request.locale.iso_code }}">

<head>
  <meta charset="utf-8">

  <meta name="viewport"
    content="width=device-width, initial-scale=1">

  <title>
    {{ page_title }}
  </title>

  {{ content_for_header }}

  {{ 'base.css' | asset_url | stylesheet_tag }}
</head>

<body>

  {% sections 'header-group' %}

  <main id="MainContent">
    {{ content_for_layout }}
  </main>

  {% sections 'footer-group' %}

</body>
</html>

This example demonstrates a simplified theme layout.

Important Liquid objects include:

  • page_title – Provides the current page title.
  • request.locale.iso_code – Provides the current locale.
  • content_for_header – Outputs Shopify-required header content.
  • content_for_layout – Renders the current page template.
  • sections – Allows section groups to be rendered.

Both content_for_header and content_for_layout are required in the main layout file.

The layout creates a consistent structure while allowing individual templates to display different content.

Step 3: Learn Shopify Liquid Fundamentals

Liquid is the foundation of dynamic Shopify theme development.

It allows developers to access store information and control how content is displayed.

Liquid has three primary components: objects, tags, and filters.

Liquid Objects

Objects provide access to Shopify store data.

Example:

<h1>{{ product.title }}</h1>

<p>{{ product.price | money }}</p>

<p>{{ product.vendor }}</p>

This code displays the current product’s title, price, and vendor.

Some commonly used Liquid objects include:

  • product
  • collection
  • cart
  • shop
  • customer
  • page
  • blog
  • article
  • settings

Liquid Tags

Tags control the logic of Liquid templates.

Example:

{% if product.available %}

  <p>In Stock</p>

{% else %}

  <p>Sold Out</p>

{% endif %}

This code checks product availability and displays an appropriate message.

Liquid Filters

Filters modify the output of Liquid objects and variables.

Example:

{{ product.title | upcase }}

This displays the product title in uppercase letters.

You can also format prices:

{{ product.price | money }}

Understanding these three components is essential before moving into advanced theme development.

Step 4: Create Custom Shopify Sections

Sections are among the most important features of modern Shopify theme development.

They allow developers to create reusable components that merchants can manage through the Shopify Theme Editor.

For example, you can create a custom image banner section with editable heading, description, and button settings.

Create a new file inside the sections folder:

custom-banner.liquid

Add the following code:

<section class="custom-banner">

  <div class="custom-banner__content">

    <h1>
      {{ section.settings.heading }}
    </h1>

    <p>
      {{ section.settings.description }}
    </p>

    {% if section.settings.button_label != blank %}

      <a href="{{ section.settings.button_link }}">
        {{ section.settings.button_label }}
      </a>

    {% endif %}

  </div>

</section>

<style>
  .custom-banner {
    padding: 80px 20px;
    text-align: center;
    background: #f5f5f5;
  }

  .custom-banner__content {
    max-width: 900px;
    margin: auto;
  }

  .custom-banner h1 {
    font-size: 42px;
    margin-bottom: 20px;
  }

  .custom-banner p {
    font-size: 18px;
  }
</style>

{% schema %}
{
  "name": "Custom Banner",
  "settings": [
    {
      "type": "text",
      "id": "heading",
      "label": "Heading",
      "default": "Welcome to Our Store"
    },
    {
      "type": "textarea",
      "id": "description",
      "label": "Description",
      "default": "Discover our latest collection."
    },
    {
      "type": "text",
      "id": "button_label",
      "label": "Button Label",
      "default": "Shop Now"
    },
    {
      "type": "url",
      "id": "button_link",
      "label": "Button Link"
    }
  ],
  "presets": [
    {
      "name": "Custom Banner"
    }
  ]
}
{% endschema %}

How Does This Section Work?

The section uses section.settings to retrieve values entered through the Shopify Theme Editor.

For example:

  • section.settings.heading displays the custom heading.
  • section.settings.description displays the description.
  • section.settings.button_label controls the button text.
  • section.settings.button_link controls the button destination.

The schema defines which settings merchants can edit.

After saving the file, open your Shopify Theme Editor and add the Custom Banner section to a supported page.

You can now change the heading, description, and button without editing the Liquid code again.

Step 5: Build Reusable Shopify Snippets

Snippets help developers organize their code and avoid repeating the same HTML and Liquid structures.

For example, if your store displays product cards in multiple sections, you can create a reusable product card snippet.

Create a file named:

product-card.liquid

Add:

<div class="product-card">

  <a href="{{ card_product.url }}">

    {% if card_product.featured_image %}

      {{
        card_product.featured_image
        | image_url: width: 600
        | image_tag:
          loading: 'lazy',
          alt: card_product.title
      }}

    {% endif %}

    <h3>
      {{ card_product.title }}
    </h3>

  </a>

  <p>
    {{ card_product.price | money }}
  </p>

</div>

You can render this snippet from another section or template:

{% render 'product-card',
  card_product: product
%}

You can also use it inside a product loop:

{% for product in collection.products %}

  {% render 'product-card',
    card_product: product
  %}

{% endfor %}

This approach keeps your theme organized and makes it easier to update product card designs across multiple areas of your website.

Step 6: Create Custom Product Templates

Product pages are among the most important parts of an eCommerce store.

A custom product template allows you to control how product information, images, prices, variants, and other content are displayed.

Modern Shopify themes generally use JSON product templates that reference different sections.

For example, a simplified product.json template can look like this:

{
  "sections": {
    "main": {
      "type": "main-product",
      "settings": {}
    }
  },
  "order": [
    "main"
  ]
}

The main-product section controls the primary product page content.

You can customize this section to display:

  • Product title and description.
  • Product images and media.
  • Product prices.
  • Product variants.
  • Availability information.
  • Add to Cart functionality.
  • Product recommendations.
  • Additional product details.

For example, you can display a custom product message using Liquid:

{% if product.available %}

  <p class="product-status">
    Available for Purchase
  </p>

{% else %}

  <p class="product-status">
    Currently Unavailable
  </p>

{% endif %}

For advanced product pages, you can also use product metafields to display additional information such as specifications, materials, warranty details, and size guides.

Step 7: Create Custom Collection Templates

Collection pages organize products into categories and help customers discover relevant items.

For example, a clothing store might have collections for men’s clothing, women’s clothing, accessories, and new arrivals.

You can use Liquid to display collection information dynamically.

Example:

<h1>{{ collection.title }}</h1>

<p>{{ collection.description }}</p>

<div class="collection-products">

  {% for product in collection.products %}

    <div class="collection-product">

      <a href="{{ product.url }}">

        <h3>
          {{ product.title }}
        </h3>

        <p>
          {{ product.price | money }}
        </p>

      </a>

    </div>

  {% endfor %}

</div>

This example displays the collection title, description, and products.

You can extend the design with product images, sorting controls, filtering options, and responsive grid layouts.

For larger collections, use Shopify’s supported pagination features rather than attempting to render every product at once.

Step 8: Add Custom Theme Settings

Theme settings allow merchants to customize global website elements through the Shopify Theme Editor.

For example, you can allow merchants to change the main brand color, background color, or typography settings.

Theme settings are generally defined inside:

config/settings_schema.json

Example:

[
  {
    "name": "Brand Colors",
    "settings": [
      {
        "type": "color",
        "id": "primary_color",
        "label": "Primary Color",
        "default": "#008060"
      }
    ]
  }
]

You can access this setting using Liquid:

<style>
  :root {
    --primary-color:
      {{ settings.primary_color }};
  }
</style>

You can then use the CSS variable throughout your theme:

.custom-button {
  background-color: var(--primary-color);
}

This makes your theme more flexible because merchants can change important design settings without editing CSS files.

Step 9: Make Your Custom Shopify Theme Mobile Responsive

Mobile responsiveness should be considered from the beginning of theme development.

Customers use smartphones, tablets, laptops, and desktop computers to browse online stores. Your custom theme should provide a consistent experience across different screen sizes.

Use CSS media queries to adjust layouts.

Example:

.product-grid {
  display: grid;
  grid-template-columns:
    repeat(4, 1fr);
  gap: 20px;
}

@media screen and (max-width: 990px) {

  .product-grid {
    grid-template-columns:
      repeat(2, 1fr);
  }

}

@media screen and (max-width: 600px) {

  .product-grid {
    grid-template-columns:
      repeat(2, 1fr);
    gap: 12px;
  }

}

This example creates a four-column product grid on larger screens and adjusts the layout for smaller devices.

You should also test:

  • Mobile navigation menus.
  • Product image sizes.
  • Buttons and form fields.
  • Typography and spacing.
  • Product variant selectors.
  • Shopping cart functionality.
  • Checkout navigation.

A responsive design makes your store easier to use and helps customers shop comfortably on any device.

Step 10: Test and Debug Your Shopify Theme

Testing is an essential part of Shopify theme development.

Even when your theme looks correct in the browser, you should verify that its functionality works properly before publishing.

Shopify CLI provides several useful development and testing features.

Preview Your Theme

Run:

shopify theme dev --store your-store.myshopify.com

This creates a development preview so you can test your theme using your Shopify store’s data.

Check Theme Errors

Run:

shopify theme check

Theme Check analyzes your theme code and identifies potential errors, performance issues, and coding problems.

Test Important Store Features

Before publishing, test:

  • Homepage sections.
  • Product and collection pages.
  • Product variants.
  • Add to Cart functionality.
  • Shopping cart updates.
  • Navigation menus.
  • Search functionality.
  • Mobile layouts.
  • Contact forms.
  • App integrations.

You should also test different product types, unavailable products, empty collections, and other situations that may affect how Liquid conditions work.

Step 11: Optimize Your Shopify Theme Performance

Website performance is an important consideration when building a custom Shopify theme.

A visually impressive store should also load quickly and provide a smooth browsing experience.

Here are some useful optimization techniques:

Optimize Images: Use appropriate image dimensions and modern image formats where suitable. Shopify’s image filters can help deliver images at the required sizes.

Reduce Unnecessary JavaScript: Avoid loading scripts that are not required on a particular page.

Use CSS Efficiently: Keep stylesheets organized and remove unused code.

Lazy Load Images: Lazy loading can reduce the initial loading workload for images that appear further down the page.

Limit Third-Party Apps: Too many apps can introduce additional scripts and requests that affect performance.

Avoid Unnecessary Liquid Processing: Keep loops and template logic efficient, especially when working with large collections.

Test Website Performance: Use Google PageSpeed Insights and other performance tools to identify issues and improvement opportunities.

Remember that website performance depends on several factors, including theme code, images, apps, scripts, and external services.

Step 12: Publish Your Custom Shopify Theme

Once your theme is complete and tested, you can upload it to your Shopify store.

Use the following command:

shopify theme push

This uploads your local theme files to Shopify.

After uploading, review the theme in Shopify Admin and make sure all required features are working correctly.

When you are ready to make the theme live, use:

shopify theme publish

Select the theme you want to publish and confirm the action.

Important: Always keep a backup of your previous live theme before publishing a new custom theme. This makes it easier to restore the previous version if something goes wrong.

Common Mistakes to Avoid During Shopify Theme Development

Building a custom Shopify theme requires careful planning and testing. Beginners sometimes make mistakes that create unnecessary development problems.

Here are some common issues to avoid:

1. Ignoring Shopify Theme Architecture

Creating too much code inside a single file makes themes difficult to maintain. Use separate sections, snippets, templates, and assets.

2. Writing Repeated Code

Avoid copying the same HTML and Liquid code into multiple files. Create reusable snippets and theme blocks where appropriate.

3. Forgetting Mobile Responsiveness

A theme that works only on desktop devices can create a poor shopping experience for mobile customers.

4. Installing Unnecessary Scripts

Third-party scripts and apps can affect loading performance. Use only the features your store actually needs.

5. Making Changes Directly to the Live Theme

Develop and test changes using an unpublished or development theme before publishing them.

6. Ignoring Theme Check

Use Shopify Theme Check to identify potential problems before deployment.

7. Using Incorrect Liquid Objects

Always verify the available objects and properties in Shopify’s official Liquid reference.

8. Overcomplicating Theme Settings

Create useful settings that give merchants control without overwhelming them with unnecessary options.

Shopify Theme Development Best Practices

Professional theme development involves more than writing functional Liquid code. A good theme should be organized, reusable, accessible, responsive, and easy for merchants to customize.

Consider following these best practices:

  • Follow Shopify’s recommended theme architecture.
  • Use JSON templates and dynamic sections.
  • Create reusable snippets and theme blocks.
  • Keep Liquid code readable and properly organized.
  • Use semantic HTML elements.
  • Follow accessibility guidelines.
  • Provide meaningful theme settings.
  • Optimize images and frontend resources.
  • Test the theme across different devices.
  • Use Shopify CLI for development and deployment.
  • Maintain version control using Git.
  • Run Theme Check regularly.
  • Keep the theme compatible with Shopify’s current platform features.

These practices make your custom theme easier to maintain and improve over time.

Shopify Theme Development using Liquid gives developers the flexibility to create unique, functional, and customizable eCommerce experiences. Instead of depending entirely on ready-made theme designs, you can build custom layouts, dynamic product pages, reusable sections, and advanced storefront features based on specific business requirements.

Start by understanding Shopify theme architecture and setting up your development environment with Shopify CLI. Then learn Liquid fundamentals, build custom sections, create reusable snippets, and work with product and collection templates.

Once you understand the basics, focus on responsive design, website performance, testing, and clean code practices. These skills will help you develop professional Shopify themes that are easier to manage and maintain.

Whether you are creating a custom Shopify theme for a new business or improving an existing online store, mastering Liquid and Shopify theme development can open up more opportunities for building advanced eCommerce websites.

We share practical Shopify development tutorials, theme customization techniques, and eCommerce insights to help developers and store owners build better Shopify experiences. Explore more of our guides to improve your Shopify development skills and discover new ways to create powerful online stores.

Founder & Shopify Expert
15+ Years of Experience

Ready to Build Your High-Converting Shopify Store?

Get a free store review and custom growth plan from a 15+ year Shopify expert.

Free Store Audit

Detailed analysis of your store performance

Actionable Plan

Step-by-step plan to increase sales & conversions

Expert Support

15+ years of Shopify experience by your side

15+

Years of Experience (Since 2010)

500+

Stores Built Worldwide

$100M+

Revenue Generated for Our Clients*

30+

Countries We Serve