[Experimental] Product Gallery: Update div elements to ul/li for better accessibility (#43612)

* Product Gallery: Update div elements to ul and li for better accessibility

* Product Gallery: Add changelog files

---------

Co-authored-by: roykho <roykho77@gmail.com>
This commit is contained in:
Danny Dudzic 2024-01-15 22:04:03 +01:00 committed by GitHub
parent 31c170f80c
commit 43be71a52f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 13 deletions

View File

@ -147,6 +147,18 @@ $admin-bar-mobile-height: 46px;
max-width: $outside-image-max-width;
}
.wc-block-product-gallery-large-image__container {
display: flex;
overflow-x: hidden;
scroll-snap-type: x mandatory;
scroll-behavior: auto;
width: fit-content;
height: fit-content;
align-items: center;
margin: 0;
padding: 0;
}
.wc-block-product-gallery-large-image__wrapper {
aspect-ratio: 1 / 1;
flex-shrink: 0;
@ -158,16 +170,6 @@ $admin-bar-mobile-height: 46px;
scroll-snap-align: none center;
}
.wc-block-product-gallery-large-image__container {
display: flex;
overflow-x: hidden;
scroll-snap-type: x mandatory;
scroll-behavior: auto;
width: fit-content;
height: fit-content;
align-items: center;
}
#{$gallery-next-previous-inside-image} & .wc-block-product-gallery-large-image__image-element {
width: fit-content;
overflow: hidden;

View File

@ -0,0 +1,3 @@
Significance: patch
Type: tweak
Comment: Product Gallery: Update div elements to ul and li for better accessibility.

View File

@ -0,0 +1,3 @@
Significance: patch
Type: tweak
Comment: Product Gallery: Update div elements to ul and li for better accessibility.

View File

@ -87,9 +87,9 @@ class ProductGalleryLargeImage extends AbstractBlock {
return strtr(
'<div class="wc-block-product-gallery-large-image wp-block-woocommerce-product-gallery-large-image" {directives}>
<div class="wc-block-product-gallery-large-image__container">
<ul class="wc-block-product-gallery-large-image__container">
{main_images}
</div>
</ul>
{content}
</div>',
array(
@ -142,7 +142,7 @@ class ProductGalleryLargeImage extends AbstractBlock {
$main_image_with_wrapper = array_map(
function( $main_image_element ) {
return "<div class='wc-block-product-gallery-large-image__wrapper'>" . $main_image_element . '</div>';
return "<li class='wc-block-product-gallery-large-image__wrapper'>" . $main_image_element . '</li>';
},
$main_images
);