Quality, Performance, Accessibility, and Shipping Intermediate 10 min read
Cross-Browser Testing and Shopify Quirks
Learn to test Shopify themes across browsers and devices, handle browser-specific issues, and navigate Shopify's platform quirks.
Themes must work across browsers, devices, and Shopify’s unique environment. This lesson covers testing strategies and common quirks you’ll encounter.
Browser Support Matrix
Priority Browsers
| Browser | Priority | Notes |
|---|---|---|
| Chrome (Desktop/Mobile) | High | Largest market share |
| Safari (Desktop/iOS) | High | iPhone/Mac users |
| Firefox | Medium | Developer audience |
| Edge | Medium | Windows default |
| Samsung Internet | Medium | Popular on Android |
Testing Environments
## Recommended Test Environments
Desktop:
- Chrome (Windows/Mac)- Safari (Mac)- Firefox (Windows/Mac)- Edge (Windows)
Mobile:
- Safari (iOS, multiple iPhone sizes)- Chrome (Android)- Samsung Internet (Android)
Tablets:
- Safari (iPad)- Chrome (Android tablet)Testing Checklist
Visual Testing
## Visual Tests
- [ ] Layout renders correctly- [ ] Images display at correct sizes- [ ] Fonts load and display- [ ] Colors match design- [ ] Hover states work- [ ] Focus states visible- [ ] Animations play smoothly- [ ] No horizontal overflow- [ ] Sticky elements workFunctional Testing
## Functional Tests
- [ ] Navigation menus work- [ ] Mobile menu opens/closes- [ ] Dropdowns function- [ ] Forms submit correctly- [ ] Cart updates- [ ] Variant selection works- [ ] Search functions- [ ] Filtering/sorting works- [ ] Modal/drawer interactions- [ ] Sliders/carousels workCommon Browser Issues
Safari Issues
/* Flexbox gap not supported in older Safari *//* Use margin fallback */.flex-container { display: flex; gap: 1rem; /* Modern browsers */}
@supports not (gap: 1rem) { .flex-container > * + * { margin-left: 1rem; }}
/* Sticky positioning in Safari */.sticky-header { position: -webkit-sticky; /* Safari */ position: sticky; top: 0;}
/* 100vh issue on iOS Safari */.full-height { height: 100vh; height: 100dvh; /* Dynamic viewport height */}Safari Form Styling
/* Reset Safari form styles */input,button,select,textarea { -webkit-appearance: none; appearance: none; border-radius: 0;}
/* Fix select dropdown arrow */select { background-image: url('data:image/svg+xml,...'); background-repeat: no-repeat; background-position: right 0.5rem center;}iOS Safari Specifics
/* Prevent zoom on input focus */@media screen and (max-width: 768px) { input, select, textarea { font-size: 16px; /* Prevents zoom */ }}
/* Safe area insets for notch */.footer { padding-bottom: env(safe-area-inset-bottom);}
/* Momentum scrolling */.scroll-container { -webkit-overflow-scrolling: touch; overflow-y: auto;}Firefox Issues
/* Scrollbar styling (Firefox) */* { scrollbar-width: thin; scrollbar-color: var(--color-primary) var(--color-background);}
/* Number input spinner */input[type='number'] { -moz-appearance: textfield;}Edge/IE Legacy
{# Detect and warn legacy browsers #}<!--[if IE]><div class="browser-warning"> Your browser is not supported. Please upgrade.</div><![endif]-->Shopify-Specific Quirks
Preview Bar Offset
/* Account for Shopify preview bar */.sticky-header { top: 0;}
/* When preview bar is present */html.shopify-preview { --header-offset: 44px;}
.shopify-preview .sticky-header { top: var(--header-offset);}Theme Editor Context
{# Detect theme editor #}{%- if request.design_mode -%} {# Theme editor specific code #} <style> /* Styles only in editor */ </style>{%- endif -%}Section Rendering API
// Handle section re-renders in theme editordocument.addEventListener('shopify:section:load', (event) => { // Reinitialize components in the section initializeSlider(event.target);});
document.addEventListener('shopify:section:unload', (event) => { // Cleanup before section is removed destroySlider(event.target);});
document.addEventListener('shopify:block:select', (event) => { // Block was selected in editor scrollToBlock(event.target);});Cart Token Issues
// Cart may have different tokens between contexts// Always use relative URLs for cart operationsfetch('/cart/add.js', { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ id: variantId, quantity: 1, }),});Currency Formatting
{# Use money filters consistently #}{{ product.price | money }} {# $10.00 #}{{ product.price | money_without_currency }} {# 10.00 #}{{ product.price | money_with_currency }} {# $10.00 USD #}
{# For JavaScript #}<script> const price = {{ product.price | json }}; {# Cents: 1000 #} const formatted = Shopify.formatMoney(price);</script>Predictive Search Limits
// Predictive search has rate limits// Debounce search requestslet searchTimeout;searchInput.addEventListener('input', () => { clearTimeout(searchTimeout); searchTimeout = setTimeout(() => { performSearch(searchInput.value); }, 300);});Testing Tools
Browser DevTools
## DevTools Features to Use
- Device emulation (mobile sizes)- Network throttling (slow 3G)- Disable cache- Console for JavaScript errors- Network tab for failed requests- Application tab for storage issuesBrowserStack/LambdaTest
For testing real devices:
- Multiple browser versions
- Real iOS and Android devices
- Screenshot comparisons
- Video recording
Local Testing
# Serve theme locally with Shopify CLIshopify theme dev
# Test on different devices on same network# Use the network URL providedResponsive Testing
Key Breakpoints
/* Common breakpoints */@media (max-width: 479px) { /* Small mobile */}@media (min-width: 480px) { /* Large mobile */}@media (min-width: 768px) { /* Tablet */}@media (min-width: 1024px) { /* Desktop */}@media (min-width: 1200px) { /* Large desktop */}Testing Matrix
## Viewport Testing
- [ ] 320px (iPhone SE)- [ ] 375px (iPhone 12/13/14)- [ ] 414px (iPhone Plus)- [ ] 768px (iPad portrait)- [ ] 1024px (iPad landscape)- [ ] 1280px (Laptop)- [ ] 1440px (Desktop)- [ ] 1920px (Large display)JavaScript Compatibility
Feature Detection
// Check for feature supportif ('IntersectionObserver' in window) { // Use IntersectionObserver} else { // Fallback for older browsers}
// CSS feature detectionif (CSS.supports('gap', '1rem')) { // Gap is supported}Polyfills
{# Load polyfills conditionally #}<script> if (!('IntersectionObserver' in window)) { document.write('<script src="{{ 'intersection-observer-polyfill.js' | asset_url }}"><\/script>'); }</script>Debugging Strategies
Console Logging
// Identify issues quicklyconsole.log('Cart:', cart);console.error('Failed to add to cart:', error);
// Group related logsconsole.group('Product Form');console.log('Variant:', selectedVariant);console.log('Quantity:', quantity);console.groupEnd();Liquid Debugging
{# Debug Liquid variables #}<pre style="background: #f0f0f0; padding: 1rem;"> {{ product | json }}</pre>
{# Conditional debug output #}{%- if request.design_mode -%} <!-- Debug: template = {{ template }} -->{%- endif -%}Testing Workflow
## Pre-Launch Testing Workflow
1. **Development Testing** - Test in primary browser during development - Check responsive at key breakpoints - Verify JavaScript functionality
2. **Cross-Browser Testing** - Test in all priority browsers - Check mobile browsers on real devices - Test tablet layouts
3. **Shopify-Specific Testing** - Test in theme editor - Test section re-rendering - Test with apps installed - Test checkout flow
4. **Edge Cases** - Long content/titles - Missing images - Empty collections - Sold out products - Multiple currenciesCommon Fixes
| Issue | Fix |
|---|---|
| Layout broken in Safari | Check flexbox gap support |
| Sticky not working iOS | Add -webkit-sticky |
| Input zooming on iOS | Set font-size: 16px minimum |
| 100vh too tall on mobile | Use 100dvh or JavaScript |
| Fonts not loading | Check font-display property |
| Animations janky | Use transform over position |
Practice Exercise
Test a theme across browsers:
- Create a testing checklist
- Test in Chrome, Safari, Firefox
- Test on iOS and Android devices
- Document issues found
- Apply fixes and retest
Key Takeaways
- Test priority browsers based on audience
- Safari has unique quirks especially on iOS
- Shopify context matters (editor, preview bar)
- Use feature detection not browser detection
- Real device testing catches issues emulators miss
- Document fixes for future reference
- Systematic testing catches more issues
What’s Next?
The next lesson covers Versioning, Releases, and Deployment for managing theme updates.
Finished this lesson?
Mark it complete to track your progress.
Discussion
Loading comments...