Development Philosophy
Horizon follows these core principles:Web-Native
Leverage the latest web browsers to their fullest, while maintaining support for older ones through progressive enhancement—not polyfills.
Lean and Fast
Functionality and design defaults to “no” until it meets quality requirements. Code ships on quality.
Server-Rendered
HTML must be rendered by Shopify servers using Liquid. Business logic and platform primitives belong on the server.
Functional, Not Pixel-Perfect
Use semantic markup, progressive enhancement, and clever design to ensure themes remain functional regardless of browser.
Daily Development Workflow
Start the development server
Begin each session by starting the local development server:This command:
- Uploads your theme to your development store
- Starts a local server at
http://127.0.0.1:9292 - Watches for file changes and syncs them automatically
- Provides hot reload functionality
Make your changes
Edit theme files in your code editor. Changes are automatically synced to your development store.Common files you’ll work with:
/templates/*.liquid- Page templates/sections/*.liquid- Reusable sections/snippets/*.liquid- Smaller reusable components/blocks/*.liquid- Theme blocks/assets/*.css- Stylesheets/assets/*.js- JavaScript files
Test in the browser
Preview changes in real-time using the local preview URL or the theme editor preview link.
Working with Git
Staying Up to Date with Horizon Changes
If you’re building a theme based on Horizon and want to pull in the latest changes:Theme Structure Best Practices
Server-First Development
- Business logic belongs on the server: Use Liquid for translations, money formatting, and platform primitives
- Progressive enhancement: Start with working HTML, then enhance with JavaScript
- Minimal client-side rendering: Async rendering is OK, but use it sparingly
Code Organization
- Sections for major components: Use sections for reusable, configurable components
- Snippets for shared markup: Extract common HTML patterns into snippets
- Theme blocks for flexibility: Leverage theme blocks for customizable layouts
Performance Considerations
- Lean by default: Only add features that are necessary
- Optimize assets: Minify CSS and JavaScript
- Lazy load when appropriate: Defer non-critical resources
- Use native browser features: Avoid polyfills when possible
Testing Your Theme
Manual Testing Checklist
- Test on multiple browsers (Chrome, Firefox, Safari, Edge)
- Test responsive design on various screen sizes
- Test with different theme settings
- Verify accessibility with keyboard navigation
- Check performance with browser DevTools
Automated Validation
Deployment Workflow
Push to a new theme
Upload your theme to the store without making it live:This creates a new theme you can preview and test.
Common Development Tasks
Adding a New Section
- Create a new
.liquidfile in/sections/ - Define the section schema with settings
- Test in the theme editor
- Run Theme Check to validate
Modifying Styles
- Edit CSS files in
/assets/ - Changes sync automatically with
shopify theme dev - Test responsive breakpoints
- Verify progressive enhancement
Working with Locales
- Edit translation files in
/locales/ - Use Liquid translation filters:
{{ 'key' | t }} - Test with different locale settings
Troubleshooting Tips
Changes Not Appearing
- Check the CLI output for sync errors
- Hard refresh your browser (Cmd/Ctrl + Shift + R)
- Verify the file is being watched (not in
.shopifyignore) - Restart the development server
Theme Check Errors
- Read the error message carefully
- Check the Theme Check documentation
- Fix issues incrementally
- Re-run validation after each fix
Merge Conflicts with Upstream
- Identify conflicting files
- Manually resolve conflicts in your editor
- Test thoroughly after resolving
- Commit the resolved changes
Next Steps
Shopify CLI Reference
Complete guide to Shopify CLI commands
Theme Check
Learn about validation and linting
Customization
Customize Horizon for your needs
Contributing
Learn about contributing to Horizon