{%- comment -%} MIT License · (c) 2026 Lintel · https://lintelagency.com/resources/shopify-sections {%- endcomment -%} {% doc %} Responsive image with optional art direction: a separate mobile image (below 750px), each honouring its own focal point from the theme editor. Falls back to a placeholder. @param {image} [image] - Desktop image (also used on mobile when no mobile image is set) @param {image} [image_mobile] - Mobile image, below 750px @param {string} [class] - Class for the img element @param {string} [sizes] - sizes attribute for the desktop image (default 100vw) @param {boolean} [eager] - Load immediately with high fetch priority (use for the first sections on a page) @param {string} [placeholder] - placeholder_svg_tag name when no image is set (default 'lifestyle-1') @example {% render 'lib-image', image: section.settings.image, image_mobile: section.settings.image_mobile, class: 'lib-hero__img', sizes: '(min-width: 990px) 50vw, 100vw', eager: true %} {% enddoc %} {%- liquid assign desktop = image if desktop == blank assign desktop = image_mobile endif assign img_sizes = sizes | default: '100vw' assign img_loading = 'lazy' assign img_priority = 'auto' if eager assign img_loading = 'eager' assign img_priority = 'high' endif assign art = false if image != blank and image_mobile != blank assign art = true endif -%} {%- if desktop != blank -%} {%- if art -%} {%- endif -%} {{ desktop | image_url: width: 2400 | image_tag: class: class, loading: img_loading, fetchpriority: img_priority, sizes: img_sizes, widths: '600, 900, 1200, 1600, 2000, 2400' }} {%- else -%} {{ placeholder | default: 'lifestyle-1' | placeholder_svg_tag: class }} {%- endif -%} {% stylesheet %} .lib-picture { display: contents; } @media (max-width: 749px) { /* image_tag sets the desktop focal point inline; the mobile image needs its own. */ .lib-picture--art img { object-position: var(--lib-pos-m) !important; } } {% endstylesheet %}