Created
September 25, 2019 07:16
-
-
Save shopifypartners/301901a2e769dc6c6fb831d3878dd1c9 to your computer and use it in GitHub Desktop.
How to use Shopify theme settings to create mobile-specific logos |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% 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 %} | |
{% if section.settings.mobile_logo != blank %} | |
{% capture image_size %}{{ section.settings.mobile_logo_max_width }}x{% endcapture %} | |
<img src="{{ section.settings.mobile_logo | img_url: image_size }}" | |
srcset="{{ section.settings.mobile_logo | img_url: image_size }} 1x, {{ section.settings.mobile_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