Skip to content

Commit

Permalink
Merge pull request #84 from findify/feature/FI-7903-liquid-product-ca…
Browse files Browse the repository at this point in the history
…rd-layout

added aspect ratio functionality using CSS variables
  • Loading branch information
wolff95 authored Jul 3, 2024
2 parents f3aedfc + 4b7c24e commit ac86a68
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion assets/findify-product-card.css
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ a:visited:not(.button) {

.image-container {
position: relative;
padding-top: 150%;
padding-top: var(--findify-product-card-aspect-ratio);
display: inline-block;
width: 100%;
}
Expand Down
3 changes: 3 additions & 0 deletions assets/findify-variables-defaults.css
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,7 @@

/* Sidebar mobile */
--findify-sidebar-header-background-color: #000000;

/* Product Card */
--findify-product-card-aspect-ratio: 100%
}
2 changes: 1 addition & 1 deletion sections/findify-product-card.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
, media: product.featured_media
, class: 'first-image' %}
{% endif %}
{%- if product.media[1] != null -%}
{%- if product.media[1] != null and showHoverImage == 'true' -%}
{% render 'findify-product-image'
, media: product.media[1]
, class: 'second-image' %}
Expand Down
5 changes: 5 additions & 0 deletions snippets/findify-product-card-connector.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
if query_parameters contains "collectionSlot="
assign collection_slot = query_parameters | split: "collectionSlot=" | last | split: "&" | first
endif
# Product Show Hover Image
if query_parameters contains "showHoverImage="
assign showHoverImage = query_parameters | split: "showHoverImage=" | last | split: "&" | first
endif

# Product metadata
assign colormap = query_parameters | split: "colormap=" | last | split: "&" | first | split: ';'
assign position = query_parameters | split: "position=" | last | split: "&" | first
Expand Down

0 comments on commit ac86a68

Please sign in to comment.