Commit f8516430800 for woocommerce
commit f85164308008d40756773abaf89f9a5ad8df6bf5
Author: Albert Juhé Lluveras <contact@albertjuhe.com>
Date: Tue Sep 22 12:38:35 2026 +0200
Prevent Cart line items from overflowing in very narrow displays (#68912)
* Typo
* Add changelog
* Prevent Cart line items from overflowing in very narrow displays
* Limit fixes to 'below-medium' size
* Make sure changes are applied to Mini-Cart
* Remove padding+gap duplication on tablet
diff --git a/plugins/woocommerce/changelog/fix-cart-line-items-reduce-padding b/plugins/woocommerce/changelog/fix-cart-line-items-reduce-padding
new file mode 100644
index 00000000000..721532b1af5
--- /dev/null
+++ b/plugins/woocommerce/changelog/fix-cart-line-items-reduce-padding
@@ -0,0 +1,4 @@
+Significance: patch
+Type: fix
+
+Prevent Cart line items from overflowing in very narrow displays
diff --git a/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/cart-line-items-table/style.scss b/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/cart-line-items-table/style.scss
index b93d6b659d0..9a0d911455b 100644
--- a/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/cart-line-items-table/style.scss
+++ b/plugins/woocommerce/client/blocks/assets/js/base/components/cart-checkout/cart-line-items-table/style.scss
@@ -156,14 +156,27 @@ table.wc-block-cart-items {
}
.wc-block-cart-items__row {
display: grid;
- grid-template-columns: 80px 132px;
- column-gap: $gap;
+ grid-template-columns: 60px 132px;
+ column-gap: $gap-small;
padding: $gap 0;
+ @include cart-checkout-medium-container {
+ grid-template-columns: 80px 132px;
+ column-gap: $gap-large;
+ }
+
+ @include cart-checkout-large-container {
+ grid-template-columns: 80px 132px;
+ column-gap: $gap;
+ }
+
.wc-block-cart-item__image {
grid-column-start: 1;
grid-row-start: 1;
- padding-right: $gap;
+
+ @include cart-checkout-large-container {
+ padding-right: $gap;
+ }
}
.wc-block-cart-item__product {
grid-column-start: 2;
@@ -176,7 +189,6 @@ table.wc-block-cart-items {
grid-column-start: 1;
grid-row-start: 2;
vertical-align: bottom;
- padding-right: $gap;
padding-top: 0;
}
.wc-block-cart-item__total {
@@ -198,7 +210,7 @@ table.wc-block-cart-items {
}
}
-// Styles for the mini cart block which is not a container and still uses the `is-` classes
+// Styles for the Mini-Cart block which is not a container and still uses the `is-` classes
.is-medium,
.is-small,
.is-mobile {