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

Commit

Permalink
Product Gallery: fix CSS leak (#11111)
Browse files Browse the repository at this point in the history
* fix CSS leak

* fix css

* fix comment
  • Loading branch information
gigitux authored Oct 9, 2023
1 parent 1b4e1c5 commit 1dcaf98
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions assets/js/blocks/product-gallery/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ $next-previous: "#{$large-image}-next-previous";
$next-previous-left-off: "#{$next-previous}-left--off";
$next-previous-right-off: "#{$next-previous}-right--off";
$gallery-next-previous-outside-image: "#{$gallery}[data-next-previous-buttons-position='outsideTheImage']:not(.is-single-product-gallery-image)";
$gallery-next-previous-inside-image: "#{$gallery}:not([data-next-previous-buttons-position='outsideTheImage']:not(.is-single-product-gallery-image))";


$outside-image-offset: 30px;
$outside-image-max-width: calc(100% - (2 * $outside-image-offset));
Expand Down Expand Up @@ -61,6 +63,12 @@ $outside-image-max-width: calc(100% - (2 * $outside-image-offset));
margin: 0 auto;
}

#{$gallery-next-previous-inside-image} & .wc-block-woocommerce-product-gallery-large-image__container {
overflow: unset;
max-width: unset;
margin: unset;
}

img {
display: block;
position: relative;
Expand Down Expand Up @@ -95,6 +103,12 @@ $outside-image-max-width: calc(100% - (2 * $outside-image-offset));
margin-left: $outside-image-offset;
margin-right: $outside-image-offset;
}

// Unset the margin of the inner blocks when the Next/Previous buttons are inside the image.
#{$gallery-next-previous-inside-image} & > * {
margin-left: unset;
margin-right: unset;
}
}
}

Expand Down

0 comments on commit 1dcaf98

Please sign in to comment.