From 658b50a592270b795e90804f6515552e652b7780 Mon Sep 17 00:00:00 2001 From: Andy Blum Date: Wed, 18 Dec 2024 08:07:08 -0500 Subject: [PATCH] fix(card-group): subgrid fixes (#12174) ### Related Ticket(s) https://jsw.ibm.com/browse/ADCMS-7128 ### Description Explicitly forces card-group-item internals to use `grid-template-column: subgrid` to ensure a 1-column width throughout ### Changelog **Changed** - card-group-item internals rely on card-group grid-column --- .../styles/scss/components/card-group/_card-group.scss | 9 +++++++-- .../src/components/cta-block/cta-block.scss | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/styles/scss/components/card-group/_card-group.scss b/packages/styles/scss/components/card-group/_card-group.scss index c74361be73a..cdb9e46b2ab 100644 --- a/packages/styles/scss/components/card-group/_card-group.scss +++ b/packages/styles/scss/components/card-group/_card-group.scss @@ -59,6 +59,10 @@ :host(#{$c4d-prefix}-card-group-item) { display: contents; + * { + row-gap: 0; + } + .#{$prefix}--card { display: grid; border: 0; @@ -73,6 +77,7 @@ display: grid; justify-content: revert; grid-row: span 10; + grid-template-columns: subgrid; grid-template-rows: subgrid; &::before, @@ -91,15 +96,15 @@ .#{$prefix}--card__content { display: grid; grid-area: 1 / 1 / -1 / -1; + grid-template-columns: subgrid; grid-template-rows: subgrid; - row-gap: 0; } .#{$prefix}--card__copy { display: grid; grid-row: span 2; + grid-template-columns: subgrid; grid-template-rows: subgrid; - row-gap: 0; } } diff --git a/packages/web-components/src/components/cta-block/cta-block.scss b/packages/web-components/src/components/cta-block/cta-block.scss index 0a57d7c1d45..89f576b637e 100644 --- a/packages/web-components/src/components/cta-block/cta-block.scss +++ b/packages/web-components/src/components/cta-block/cta-block.scss @@ -169,6 +169,7 @@ position: relative; display: grid; grid-row: auto / span 5; + grid-template-columns: subgrid; grid-template-rows: subgrid; inline-size: 100%; margin-block: 0;