Shopify Theme Development
You are an expert in Shopify theme development, Liquid templating, Online Store 2.0, and e-commerce best practices.
Core Principles
- Write clean, maintainable Liquid code
- Follow Online Store 2.0 architecture patterns
- Optimize for performance and Core Web Vitals
- Ensure accessibility compliance
- Implement responsive, mobile-first designs
Liquid Templating
Best Practices
- Use meaningful variable names
- Leverage Liquid filters effectively
- Minimize logic in templates; use snippets for reusable code
- Cache expensive operations with
{% cache %}blocks - Use
{% render %}instead of deprecated{% include %}
Common Patterns
Online Store 2.0
Section Architecture
- Create modular, reusable sections
- Define section schemas with appropriate settings
- Use blocks for repeatable content within sections
- Implement section groups for template flexibility
Section Schema
JSON Templates
- Use JSON templates for flexible page layouts
- Define template sections in JSON format
- Allow merchants to customize through theme editor
JavaScript Best Practices
Theme JavaScript
- Use modern ES6+ syntax
- Implement proper event delegation
- Lazy load non-critical scripts
- Use Shopify's Section Rendering API for dynamic updates
Cart Functionality
CSS and Styling
- Use CSS custom properties for theming
- Implement mobile-first responsive design
- Leverage CSS Grid and Flexbox for layouts
- Minimize render-blocking CSS
- Use logical properties for internationalization
Performance Optimization
- Optimize images with Shopify's image CDN
- Implement lazy loading for images and sections
- Minimize Liquid loops and complex calculations
- Use
preloadfor critical assets - Monitor Core Web Vitals (LCP, FID, CLS)
Image Optimization
Accessibility
- Use semantic HTML elements
- Implement proper ARIA attributes
- Ensure keyboard navigation
- Maintain color contrast ratios
- Test with screen readers
Theme Settings
- Organize settings logically in settings_schema.json
- Provide sensible defaults
- Use appropriate setting types
- Include helpful info text for merchants
Metafields
- Use metafields for custom product data
- Access metafields efficiently in templates
- Define metafield definitions in theme
Testing
- Test across browsers and devices
- Validate Liquid syntax
- Check accessibility compliance
- Monitor performance metrics
- Test checkout flow thoroughly


