From 5cbafa6be1dbee528929d57201f0a963d6d32341 Mon Sep 17 00:00:00 2001 From: Daniel Dudzic Date: Tue, 3 Oct 2023 22:40:20 +0200 Subject: [PATCH 1/2] Product Gallery: Add a better default Dialog template part --- assets/js/blocks/product-gallery/style.scss | 25 +++++++++++++++- templates/parts/product-gallery.html | 32 ++++++++++----------- 2 files changed, 40 insertions(+), 17 deletions(-) diff --git a/assets/js/blocks/product-gallery/style.scss b/assets/js/blocks/product-gallery/style.scss index 314ba66f912..f5eb207810c 100644 --- a/assets/js/blocks/product-gallery/style.scss +++ b/assets/js/blocks/product-gallery/style.scss @@ -26,7 +26,7 @@ $outside-image-max-width: calc(100% - (2 * $outside-image-offset)); width: calc(100vw - 100px); border: none; border-radius: 10px; - height: 90vh; + height: calc(100vh - 100px); top: 0; margin-top: $gap-largest; margin-bottom: $gap-largest; @@ -68,6 +68,11 @@ $outside-image-max-width: calc(100% - (2 * $outside-image-offset)); z-index: 1; transition: all 0.1s linear; + dialog & { + max-height: 80vh; + width: auto; + } + // Keep the order in this way. The hoverZoom class should override the full-screen-on-click class when both are applied. &.wc-block-woocommerce-product-gallery-large-image__image--full-screen-on-click { cursor: pointer; @@ -199,6 +204,15 @@ $outside-image-max-width: calc(100% - (2 * $outside-image-offset)); // Thumbnails #{$thumbnails} { + + dialog & { + height: calc(100vh - 160px); + overflow-y: scroll; + display: flex; + flex-flow: column wrap; + justify-content: flex-start; + } + img { cursor: pointer; } @@ -213,6 +227,15 @@ $outside-image-max-width: calc(100% - (2 * $outside-image-offset)); height: 100px; margin: 5px; + dialog & { + width: auto; + height: auto; + margin: 5px; + max-width: 90px; + max-height: 90px; + min-width: 40px; + min-height: 40px; + } } } diff --git a/templates/parts/product-gallery.html b/templates/parts/product-gallery.html index 19108d590fd..dc449278483 100644 --- a/templates/parts/product-gallery.html +++ b/templates/parts/product-gallery.html @@ -1,27 +1,27 @@
- -