Skip to content

Instantly share code, notes, and snippets.

@shopifypartners
shopifypartners / mobile-logo-styles.scss
Created September 25, 2019 07:22
How to use Shopify theme settings to create mobile-specific logos |
/*================ Display and hide logo images on header ================*/
/* Large devices (over 700 px) */
@media only screen and (min-width: 701px) {
#mobile{
display:none;
}
}
/* Small devices (under 700 px) */
@shopifypartners
shopifypartners / mobile-logo-markup.liquid
Created September 25, 2019 07:19
How to use Shopify theme settings to create mobile-specific logos |
<div id="desktop">
{% 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 %}
</div>
@shopifypartners
shopifypartners / duplicate-logo-markup.liquid
Created September 25, 2019 07:16
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 %}
{% if section.settings.mobile_logo != blank %}
@shopifypartners
shopifypartners / mobile-logo-settings.json
Created September 25, 2019 07:10
How to use Shopify theme settings to create mobile-specific logos |
{
"type": "image_picker",
"id": "logo",
"label": "Logo image"
},
{
"type": "range",
"id": "logo_max_width",
"min": 50,
"max": 450,
@shopifypartners
shopifypartners / duplicate-logo-settings.json
Last active September 25, 2019 07:09
How to use Shopify theme settings to create mobile-specific logos |
{
"type": "image_picker",
"id": "logo",
"label": "Logo image"
},
{
"type": "range",
"id": "logo_max_width",
"min": 50,
"max": 450,
@shopifypartners
shopifypartners / logo-markup.liquid
Created September 25, 2019 07:05
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 %}
@shopifypartners
shopifypartners / logo-settings.json
Created September 25, 2019 07:04
How to use Shopify theme settings to create mobile-specific logos |
{
"type": "image_picker",
"id": "logo",
"label": "Logo image"
},
{
"type": "range",
"id": "logo_max_width",
"min": 50,
"max": 450,
@shopifypartners
shopifypartners / gallery.liquid
Last active September 26, 2019 14:58
Example of a product gallery that has been updated to support for media
{
"type": "checkbox",
"id": "show_product_recommendations",
"label": "Turn on product recommendations",
"default": false
}
.layout-main {
display: inline-block;
display: flex;
display: grid;
width: 100%;
}
.layout-main__left {
float: left;
width: 75%;