Skip to content

Instantly share code, notes, and snippets.

@shopifypartners
Created September 25, 2019 07:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shopifypartners/233fe9ca3d47ef38bf96a6b93395bc1e to your computer and use it in GitHub Desktop.
Save shopifypartners/233fe9ca3d47ef38bf96a6b93395bc1e to your computer and use it in GitHub Desktop.
How to use Shopify theme settings to create mobile-specific logos |
{% if section.settings.logo != blank %}
{% capture image_size %}{{ section.settings.logo_max_width }}x{% endcapture %}
<img src="{{ section.settings.logo | img_url: image_size }}"
srcset="{{ section.settings.logo | img_url: image_size }} 1x, {{ section.settings.logo | img_url: image_size, scale: 2 }} 2x"
alt="{{ section.settings.logo.alt | default: shop.name }}">
{% else %}
{{ shop.name }}
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment