Quick Start
Get up and running with Horizon in minutes. This guide will walk you through cloning the repository, installing dependencies, and launching your local development environment.Clone the Repository
Clone the Horizon repository from GitHub to your local machine:This creates a local copy of the Horizon theme in a directory called
horizon.Install Shopify CLI
Shopify CLI is essential for theme development. It provides commands for working with themes on a Shopify store and launching a local development server.Install via Homebrew (macOS/Linux):Install via npm:Install via Ruby gem:Verify the installation:
You’ll need Node.js 18+ and npm 8+ for the npm installation method.
Connect to a Shopify Store
Authenticate with Shopify and connect your theme to a development store:This command will:
- Prompt you to log in to your Shopify Partner account
- Let you select or create a development store
- Upload your theme to the store
- Start a local development server
Development Workflow
File Watching & Hot Reload
The Shopify CLI development server watches your theme files and automatically syncs changes to your store:- Liquid files (
.liquid): Changes are synced and the page reloads - Asset files (
.js,.css): Changes are synced and the page hot-reloads - Config files (
.json): Changes are synced and require a manual refresh
Theme Editor
While developing, you can use the Shopify theme editor to customize sections and settings:Project Structure
Understanding Horizon’s file structure will help you navigate and customize the theme:Core Directories
assets/ - JavaScript, CSS, and Media
assets/ - JavaScript, CSS, and Media
Contains all JavaScript, CSS, and static assets. Horizon uses vanilla JavaScript with web components:JavaScript files are loaded as ES modules with
type="module".sections/ - Page Sections
sections/ - Page Sections
Shopify sections that can be added to pages through the theme editor:Each section includes its schema for theme editor customization.
blocks/ - Reusable Theme Blocks
blocks/ - Reusable Theme Blocks
Theme blocks that can be used within sections:Blocks are prefixed with
_ to distinguish them from sections.snippets/ - Liquid Snippets
snippets/ - Liquid Snippets
Reusable Liquid code that can be rendered anywhere:Snippets are included using
{% render 'snippet-name' %}.templates/ - Page Templates
templates/ - Page Templates
JSON templates that define the default sections for each page type:
config/ - Theme Settings
config/ - Theme Settings
Global theme configuration and settings:The settings schema defines what appears in the theme editor.
Essential Commands
Here are the most common Shopify CLI commands you’ll use:Development Server
Theme Management
Theme Information
Development Tools
Horizon is set up to work with several development tools that enhance your workflow:Theme Check
Theme Check validates and lints your Shopify themes. It’s included in Horizon’s VS Code configuration. Run Theme Check:- Liquid syntax errors
- Performance issues
- Accessibility problems
- Translation key issues
Horizon runs Theme Check on every commit via Shopify/theme-check-action to ensure code quality.
Git Configuration
Horizon includes a.gitignore file configured for theme development:
Staying Up to Date
If you’re building a custom theme based on Horizon and want to pull in the latest changes:Add Upstream Remote
Add the official Horizon repository as a remote:Verify your remotes:You should see:
Troubleshooting
CLI Connection Issues
Problem: Can’t connect to Shopify storePort Already in Use
Problem: Development server won’t startFiles Not Syncing
Problem: Changes aren’t appearing in the browser- Check that the file isn’t ignored in
.shopifyignore - Try restarting the development server
- Clear your browser cache
- Check for Liquid syntax errors in the terminal
Theme Check Errors
Problem: Theme Check reports issues Run Theme Check to see specific issues:.theme-check.yml if needed.
Next Steps
Now that your development environment is set up, explore these resources:Core Concepts
Learn about Horizon’s architecture and design patterns
Components
Explore the web components that power Horizon
Theming Guide
Customize colors, typography, and styles
API Reference
Detailed API documentation for all components