From 74b47c1ccb6e030cea06509923608d2120157c18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20Gla=CC=88ser?= Date: Fri, 12 Jun 2026 08:52:05 +0200 Subject: [PATCH] Cap object group card shared width --- patterns/object-group-card.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/patterns/object-group-card.html b/patterns/object-group-card.html index f49b0d7..348be09 100644 --- a/patterns/object-group-card.html +++ b/patterns/object-group-card.html @@ -117,7 +117,9 @@ } const referenceWidth = referenceCard.getBoundingClientRect().width; - grid.style.setProperty('--layout-object-card-shared-width', `${referenceWidth}px`); + const maxWidth = parseFloat(getComputedStyle(referenceCard).maxWidth); + const sharedWidth = Number.isFinite(maxWidth) ? Math.min(referenceWidth, maxWidth) : referenceWidth; + grid.style.setProperty('--layout-object-card-shared-width', `${sharedWidth}px`); grid.classList.add('sg-object-card-grid--multi-row'); }); };