Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Product Gallery: Add a better default Dialog template part #11120

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion assets/js/blocks/product-gallery/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,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;
Expand Down Expand Up @@ -76,6 +76,11 @@ $outside-image-max-width: calc(100% - (2 * $outside-image-offset));
z-index: 1;
transition: all 0.1s linear;

dialog & {
max-height: calc(100vh - 160px);
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;
Expand Down Expand Up @@ -217,6 +222,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;
}
Expand All @@ -231,5 +245,14 @@ $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;
}
}
}
32 changes: 16 additions & 16 deletions templates/parts/product-gallery.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
<!-- wp:group {"layout":{"type":"constrained"}} -->
<div class="wp-block-group">
<!-- wp:woocommerce/product-gallery {"mode":"full"} -->
<div
class="wp-block-woocommerce-product-gallery wc-block-product-gallery wc-block-product-gallery--has-next-previous-buttons-inside-image">
<!-- wp:group {"layout":{"type":"flex","flexWrap":"nowrap"}} -->
<!-- wp:woocommerce/product-gallery {"thumbnailsNumberOfThumbnails":8,"productGalleryClientId":"a65ef9cb-c3b6-49c7-8aa5-8a4d40475eb5","mode":"full","align":"full"} -->
<div class="wp-block-woocommerce-product-gallery alignfull wc-block-product-gallery wc-block-product-gallery--has-next-previous-buttons-inside-image">
<!-- wp:group {"layout":{"type":"flex","flexWrap":"nowrap","verticalAlignment":"top"}} -->
<div class="wp-block-group">
<!-- wp:woocommerce/product-gallery-thumbnails {"lock":{"move":true,"remove":true}} /-->
<!-- wp:woocommerce/product-gallery-thumbnails {"lock":{"move":true,"remove":true},"style":{"layout":{"selfStretch":"fixed","flexSize":"200px"}}} /-->

<!-- wp:woocommerce/product-gallery-large-image {"lock":{"move":true,"remove":true}} -->
<div
class="wp-block-woocommerce-product-gallery-large-image wc-block-product-gallery-large-image__inner-blocks">
<!-- wp:woocommerce/product-sale-badge {"isDescendentOfSingleProductTemplate":true,"align":"right","style":{"spacing":{"margin":{"top":"4px","right":"4px","bottom":"4px","left":"4px"}}}} /-->
<!-- wp:group {"lock":{"move":true,"remove":true},"style":{"layout":{"selfStretch":"fill","flexSize":null}},"layout":{"type":"flex","orientation":"vertical","justifyContent":"center","flexWrap":"wrap"}} -->
<div class="wp-block-group">
<!-- wp:woocommerce/product-gallery-large-image {"lock":{"move":true,"remove":true}} -->
<div class="wp-block-woocommerce-product-gallery-large-image wc-block-product-gallery-large-image__inner-blocks">
<!-- wp:woocommerce/product-gallery-large-image-next-previous {"lock":{"move":true,"remove":true},"layout":{"type":"flex","verticalAlignment":"bottom"}} -->
<div class="wp-block-woocommerce-product-gallery-large-image-next-previous"></div>
<!-- /wp:woocommerce/product-gallery-large-image-next-previous -->
</div>
<!-- /wp:woocommerce/product-gallery-large-image -->

<!-- wp:woocommerce/product-gallery-large-image-next-previous {"layout":{"type":"flex","verticalAlignment":"bottom"}} -->
<div class="wp-block-woocommerce-product-gallery-large-image-next-previous"></div>
<!-- /wp:woocommerce/product-gallery-large-image-next-previous -->
<!-- wp:woocommerce/product-gallery-pager {"lock":{"move":false,"remove":false}} /-->
</div>
<!-- /wp:woocommerce/product-gallery-large-image -->
<!-- /wp:group -->
</div>
<!-- /wp:group -->

<!-- wp:woocommerce/product-gallery-pager {"lock":{"move":true,"remove":true}} /-->
</div>
<!-- /wp:woocommerce/product-gallery -->
</div>
<!-- /wp:group -->
<!-- /wp:group -->
Loading