commit ddf9cbb6a20131de77b2506f11c59b53ce311811
Author: Karol Manijak <20098064+kmanijak@users.noreply.github.com>
Date: Fri Nov 28 14:32:59 2025 +0100
Remove unnecessary Product Collection margin (#62144)
* Remove unnecessary margin top for product template when there's no notices
* Add changelog
diff --git a/plugins/woocommerce/changelog/fix-margin-product-collection b/plugins/woocommerce/changelog/fix-margin-product-collection
new file mode 100644
index 0000000000..e65d3da5b5
--- /dev/null
+++ b/plugins/woocommerce/changelog/fix-margin-product-collection
@@ -0,0 +1,4 @@
+Significance: patch
+Type: fix
+
+Product Collection: Remove unnecessary margin-top when there's no store notices displayed
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/style.scss b/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/style.scss
index b3670676d2..aa403b5f0c 100644
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/style.scss
+++ b/plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/style.scss
@@ -9,6 +9,12 @@
@include font-regular-locked;
}
+ // Gutenberg adds margin between elements but notices are often empty
+ // resulting in an unnecessary margin on product template.
+ .wc-block-components-notices:not(:has(*)) + .wc-block-product-template {
+ margin-block-start: 0;
+ }
+
&:has(.is-product-collection-layout-carousel) {
// Hide navigation buttons on mobile phones (small touch screens), but keep them
// visible on tablets and desktop (even when zoomed).