woocommerce/plugins/woocommerce-blocks/assets/js/atomic/blocks/product-elements
kmanijak 5e1896d98a Fix: skewed placeholder of product image - issuewoocommerce/woocommerce-blocks#7553 (https://github.com/woocommerce/woocommerce-blocks/pull/7651)
* Fix typo in HTML markup of ProductImage block placeholder

Typo caused rendering of incorrect HTML attributes: width and height of Product Image placeholder that were anyway ignored by the browser

* Remove inline styles (width and height) from ImagePlaceholder in ProductElements > Image block

Inline height took precedence over the inherited styles which made the placeholder image skewed (in loading and loaded state). Removal of those styles allows the ImagePlaceholder to adapt the height to the available space keeping the ratio or inherit the styles from the parent

* Remove inline styles (width and height) from placeholder image in ProductImage.php block

Inline styles applied to the placeholder image of ProductImage block were overriden by other styles with higher specificity, which made them redundant. Additionally, corresponding styles were removed from the placeholder image from Editor code as they caused UI glitches. Additional proof that it's safe to remove them is in the first commit in this branch, the purpose of which was to fix those styles as there was a typo which corrupted them and eventually inline width and height were ignored by the browser and not applied to the element

* Add test to check placeholder image renders without width and height inline attributes

This is to prevent adding inline width and height attributes so the sizing of the placeholder image is controlled by the inherited styles or element styles, in the same way as a regular product image

* Fix TypeScript errors in the block test file of Product Image

* Add generic alt text to placeholder image

Alt text added in this commit is a generic text, not description of the actual image. That's because the image itself is set externally through the settings and may change over time

* Revert adding placeholder image alt text and add comments to make the empty alt explicit

After a Github discussion: https://github.com/woocommerce/woocommerce-blocks/pull/7651\#discussion_r1019560494 it was decided the placeholder should NOT have alt text as it serves the purpose of decorative image. According to the guidelines decorative images should not have alt text: https://www.w3.org/WAI/tutorials/images/decorative/. Comments were added also to other places where it happens

* bot: update checkstyle.xml

Co-authored-by: Karol Manijak <karolm@Karols-MacBook-Pro.local>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-11-16 10:25:40 +01:00
..
add-to-cart Update ValidatedTextInput TypeScript & move to `@woocommerce/blocks-checkout` (https://github.com/woocommerce/woocommerce-blocks/pull/7583) 2022-11-10 02:05:41 -08:00
button Fix inconsistent button styling with TT3 (https://github.com/woocommerce/woocommerce-blocks/pull/7516) 2022-10-28 19:07:56 +02:00
category-list Improve public-facing texts and labels (https://github.com/woocommerce/woocommerce-blocks/pull/7045) 2022-09-12 10:39:26 +02:00
image Fix: skewed placeholder of product image - issuewoocommerce/woocommerce-blocks#7553 (https://github.com/woocommerce/woocommerce-blocks/pull/7651) 2022-11-16 10:25:40 +01:00
price Fix Price Block Inserter Visibility (https://github.com/woocommerce/woocommerce-blocks/pull/7559) 2022-11-07 14:09:26 +01:00
rating Fix ESLint errors (https://github.com/woocommerce/woocommerce-blocks/pull/7556) 2022-11-02 17:46:14 +01:00
sale-badge Fix: add missing export for Product Sale Badge (https://github.com/woocommerce/woocommerce-blocks/pull/7564) 2022-11-02 15:48:54 +07:00
shared Add Product Query Support for Atomic Rating Block (https://github.com/woocommerce/woocommerce-blocks/pull/7352) 2022-10-31 14:56:17 -04:00
sku Add Product Query Support for Atomic SKU Block (https://github.com/woocommerce/woocommerce-blocks/pull/7385) 2022-11-10 13:32:07 -05:00
stock-indicator Convert product-elements/stock-indicator to TypeScript (https://github.com/woocommerce/woocommerce-blocks/pull/7567) 2022-11-15 06:16:02 +07:00
summary Convert product-elements/summary to TypeScript (https://github.com/woocommerce/woocommerce-blocks/pull/7566) 2022-11-07 16:50:15 +07:00
tag-list Convert product-elements/tag-list to TypeScript (https://github.com/woocommerce/woocommerce-blocks/pull/7538) 2022-11-02 14:47:34 +07:00
title Create Cross-Sells product list (https://github.com/woocommerce/woocommerce-blocks/pull/6645) 2022-09-21 13:04:15 +07:00
save.js Add to the Product Image block the support for the Product Query block (https://github.com/woocommerce/woocommerce-blocks/pull/6911) 2022-09-01 15:13:19 +02:00